Jumos.jl icon indicating copy to clipboard operation
Jumos.jl copied to clipboard

Wrap Chemharp to Julia, and use it for IO

Open Luthaf opened this issue 9 years ago • 11 comments

I should wrap Chemharp to Julia, and use it to replace the Trajectories module.

I can wrap the C interface or the C++ interface here. I should have a look to Clang.jl for automatic wrapping.

Luthaf avatar May 20 '15 15:05 Luthaf

Just to let you know, if you are having difficulties with getting things like BinDeps or Homebrew.jl to work, just ping me and I'll help you get the binary dependency mojo sorted out. :)

staticfloat avatar Jun 16 '15 04:06 staticfloat

Thank you again ! I think the main difficulty for me will be to get the dependencies installed on Windows and Linux, as I am more comfortable with OS X. I am looking forward the tkelman talk at JuliaCon about the windows part. Do you thing it will be recorded ?

Luthaf avatar Jun 16 '15 07:06 Luthaf

Likely! I think they're going to try and record everything.

On Tue, Jun 16, 2015, 00:42 Luthaf [email protected] wrote:

Thank you again ! I think the main difficulty for me will be to get the dependencies installed on Windows and Linux, as I am more comfortable with OS X. I am looking forward the tkelman talk at JuliaCon about the windows part. Do you thing it will be recorded ?

— Reply to this email directly or view it on GitHub https://github.com/Luthaf/Jumos.jl/issues/20#issuecomment-112322907.

staticfloat avatar Jun 16 '15 13:06 staticfloat

I just put my slides up at https://github.com/tkelman/JuliaCon2015/blob/master/KelmanJuliaCon2015.pdf, not sure how long the recordings will take to get posted.

tkelman avatar Jun 29 '15 15:06 tkelman

Thank you, that is very nice!

Luthaf avatar Jun 29 '15 15:06 Luthaf

I'll be walking a couple people through the WinRPM packaging process soon, and making a point to write things down for better documentation going forward.

tkelman avatar Jun 29 '15 15:06 tkelman

Preview summary version from notes of walking through the process in person for LibGEOS.jl:

1. register for an account on build.opensuse.org
2. test that library can be cross-compiled, ./configure --host=x86_64-w64-mingw32
3. create home project on build.opensuse.org
4. create package for library, named mingw64-libfoo, where libfoo is the name of the linux package version of the library - copy title and description from the linux version of the package
5. click add file, upload source tarball
6. create new empty file mingw64-libfoo.spec
7. copy-paste either mingw64-zeromq.spec (for configure) or mingw64-metis.spec (for cmake)
8. replace old package name, group, description, license, url etc with your package name - copy from linux version's spec file
9. save spec file, go back to package
10. comment out list of installed files at end of spec file for now
11. click build targets
12. select and enable opensuse 13.1, 13.2 and factory
13. go to repositories, click edit repository for each
14. click add additional path to repository
15. enter windows:mingw:win64, select repository that matches each target
16. click blue scheduled, or red failed, or green succeeded icons to access build logs - download logfile for full version
17. work through error messages, if everything worked the message will be "installed but unpackaged files found"
18. adapt list of installed files for this package - executables and dll's go in main package, headers and static .a and import .dll.a libraries go in -devel subpackage
19. if package build succeeds, click download package, opensuse, show "Add repository and install manually," copy link from zypper addrepo for opensuse 13.1 (leave off the file name ending in .repo)
20. check https://www.github.com/JuliaOpt/CoinOptServices.jl/blob/master/deps/build.jl for example of adding your personal project to WinRPM.sources
21. Create a separate copy of the package but replacing mingw64 with mingw32 (and x86_64 with i686) for 32 bit windows, and repeat steps 11-15 for win32
22. enable appveyor, copy appveyor.yml from Example.jl, replacing Example with your Julia package name, and see what happens!

tkelman avatar Jul 01 '15 03:07 tkelman

Thank you, I finally managed to get my code to compile on OpenSuse build services !

I now face another issue when trying to use the produced RPM on Appveyor. My appveyor.yml is here, the dependencies file here and the RMP package is here.

With all this, I get the following build log, and specifically

> C:\projects\julia\bin\julia -e "Pkg.build(\"Chemharp\")"
[...]
INFO: Building WinRPM
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download 
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download 
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/0e8bebadadf423d314868c33de0766daf460167b5f2033ace800054c6d2de46c-primary.xml.gz
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/4a316c6334e8987fea33ed434da31639e94cec2188b13919654f02576ff9c6e1-primary.xml.gz
INFO: Building WinRPM
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
INFO: Building Chemharp
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/home:Luthaf/openSUSE_13.2//repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/home:Luthaf/openSUSE_13.2//repodata/e44b77dd2f8a332eb35df049f6f58b581744953834a6892d49d1675a1a525eef-primary.xml.gz
INFO: Updating WinRPM package list
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/home:Luthaf/openSUSE_13.2//repodata/repomd.xml
INFO: Packages to install: Chemharp
INFO: Downloading: Chemharp
INFO: Extracting: Chemharp
INFO: Complete
==============================[ ERROR: Chemharp ]=============================== 

LoadError: Provider BinDeps.PackageManager failed to satisfy dependency libchemharp
while loading C:\Users\appveyor\.julia\v0.4\Chemharp\deps\build.jl, in expression starting on line 60 

================================================================================ 

================================[ BUILD ERRORS ]=================================

WARNING: Chemharp had build errors.

 - packages with build errors remain installed in C:\Users\appveyor\.julia\v0.4
 - build the package(s) and all dependencies with `Pkg.build("Chemharp")`
 - build a single package by running its `deps/build.jl` script 

==============================================================================






> C:\projects\julia\bin\julia -e "using BinDeps; BinDeps.debug(\"Chemharp\")"
INFO: Reading build script...
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/home:Luthaf/openSUSE_13.2//repodata/repomd.xml
The package declares 1 dependencies. 
INFO: Updating WinRPM package list
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/home:Luthaf/openSUSE_13.2//repodata/repomd.xml
 - Library "libchemharp" 
    - Providers:
      - WinRPM.RPM package Chemharp 
      - Simple Build Process 

@tkelman, any idea on the failure cause here ? The log is not really informative.

Luthaf avatar Aug 31 '15 21:08 Luthaf

Possibly a dlopen failure on the library? Not sure if it will help, but I think 13.1 is what we're using as the provider for most winrpm libraries.

tkelman avatar Sep 01 '15 09:09 tkelman

Not sure if it will help, but I think 13.1 is what we're using as the provider for most winrpm libraries.

I'll try if I find how to use a more recent version of cmake on 13.1. The default one (2.11.8) is too old for me.

Luthaf avatar Sep 01 '15 11:09 Luthaf

Same issue ... I'll have to start a Windows VM.

Luthaf avatar Sep 01 '15 12:09 Luthaf