Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Linking issue #193

Open
martinsimon88 opened this issue Apr 17, 2017 · 10 comments
Open

Linking issue #193

martinsimon88 opened this issue Apr 17, 2017 · 10 comments

Comments

@martinsimon88
Copy link

Hello guys!
I am getting an error when building on Ubuntu 16.04:

[ 49%] Built target pagmo_static[ 49%] Linking CXX executable mainsrc/libpagmo.a(jde.cpp.o): In function void boost::serialization::throw_exception<boost::archive::archive_exception>(boost::archive::archive_exception const&):jde.cpp:(.text._ZN5boost13serialization15throw_exceptionINS_7archive17archive_exceptionEEEvRKT_[_ZN5boost13serialization15throw_exceptionINS_7archive17archive_exceptionEEEvRKT_]+0x1d): undefined reference to boost::archive::archive_exception::archive_exception(boost::archive::archive_exception const&)collect2: error: ld returned 1 exit statusCMakeFiles/main.dir/build.make:99: recipe for target 'main' failedmake[2]: *** [main] Error 1CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/main.dir/all' failedmake[1]: *** [CMakeFiles/main.dir/all] Error 2Makefile:138: recipe for target 'all' failedmake: *** [all] Error 2

I read the solution of #69 to change the order of linking, but my CMakeCache.txt has the following lines already:

# Link main to pagmo_static library. IF(BUILD_MAIN) ADD_EXECUTABLE(main main.cpp) TARGET_LINK_LIBRARIES(main pagmo_static ${MANDATORY_LIBRARIES}) ENDIF(BUILD_MAIN)

I also built GCC from source like this: https://solarianprogrammer.com/2016/10/07/building-gcc-ubuntu-linux/, but haven't figured out how to let pagmo know of this source-built GCC.

I tried building PyGMO and main separately, which did not work either. Although PyGMO compiled without errors, when using it gave me:

ImportError: /usr/lib/python2.7/dist-packages/PyGMO/core/_core.so: undefined symbol: _ZN5boost7archive17archive_exceptionC1ERKS1_

I appreciate any feedback :)

@darioizzo
Copy link
Member

pagmo is not maintained anymore. We are currently deploying pagmo2, it has already many of the functionalities of the old pagmo and mainly it is easily installable.

Check here the github proj: https://github.com/esa/pagmo2
Check here the differences with respect to pagmo 1: https://github.com/esa/pagmo2/wiki/From-1.x-to-2.x
Check here the current docs for pagmo2: https://esa.github.io/pagmo2/

@martinsimon88
Copy link
Author

martinsimon88 commented Apr 18, 2017 via email

@jmllorens
Copy link

Hi Martin,

I compile PyGMO 1 in 16.04 without any problem. This is the output of ldd ./core/_core.so. The only library in my $HOME is libpagmo, the rest are system libraries. Hope this helps.

    linux-vdso.so.1 =>  (0x00007fffaa7ed000)

    libpagmo.so => /home/jmllorens/SOFTWARE/local/lib/libpagmo.so (0x00007f950fa44000)

    libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007f950f812000)

    libboost_thread.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 (0x00007f950f5ec000)

    libboost_serialization.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.58.0 (0x00007f950f38a000)

    libboost_python-py27.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0 (0x00007f950f13e000)

    libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007f950ebb0000)

    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f950e82d000)

    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f950e617000)

    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f950e24e000)

    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f950e030000)

    libgsl.so.19 => /usr/lib/x86_64-linux-gnu/libgsl.so.19 (0x00007f950dbf1000)

    libgslcblas.so.0 => /usr/lib/x86_64-linux-gnu/libgslcblas.so.0 (0x00007f950d9b3000)

    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f950d6a9000)

    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f950d4a1000)

    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f950d286000)

    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f950d082000)

    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f950ce7f000)

    /lib64/ld-linux-x86-64.so.2 (0x000055cbac7a7000)

@darioizzo
Copy link
Member

Martin we are deploying the PyPi packages just these days, so for pip install you probably have to wait for the package to be uploaded.

If you try to install from source I am curious to see if you get problem. We think the new build system is rather robust ...

For the hypervolume, check the tutorial here (pygmo2): https://esa.github.io/pagmo2/docs/python/tutorials/hypervolume.html

Let me know if you have problems ....

@darioizzo
Copy link
Member

You can check what packages are available here: https://pypi.python.org/pypi/pygmo/

At the moment in linux py36 and 64 bits is available. Soon also the others .... we are waitning for the CI to finish building

@martinsimon88
Copy link
Author

martinsimon88 commented Apr 18, 2017 via email

@bluescarni
Copy link
Member

The full set of pip packages will be ready with the next version of pagmo (hopefully 2.1, but might be 2.n if we made some mistakes in the CI and need to rectify them). We will have pip packages for Windows and Linux 64bit, Python 2.7 & 3.5 + 3.6.

conda packages are in preparation as well:

https://github.com/conda-forge/pagmo-feedstock
https://github.com/conda-forge/pygmo-feedstock

@darioizzo
Copy link
Member

pygmo2 is a complete rewrite of the code. So transition requires to recode your classes. Main differences are (from the user point of view)

1 - No need to derive from a base class to instantiate a problem
2 - No separate functions for obj and constraints in the user defined problems. Everything is returned by one fitness method: obj, ec, ic (objectives, equalities, inequalities). Check the tutorial on how to code a problem here: https://esa.github.io/pagmo2/docs/python/tutorials/coding_udp_simple.html

If you mainly need access to the algorithms (a list of the available ones in pygmo2 can be found here: https://esa.github.io/pagmo2/docs/python/algorithms/py_algorithms.html) I suggest you to make the effort and change to pygmo2 as we will be developing it and dropping all development for pygmo1

If you do not want to make the effort (understandable) then I cannot offer much support on your installation problems (pygmo had a rather buggy build system ....), but we can still try to help on syntactic issues ....

@martinsimon88
Copy link
Author

martinsimon88 commented Apr 18, 2017 via email

@darioizzo
Copy link
Member

darioizzo commented Apr 18, 2017

Not yet, but its rather easy (something like):

class my_algorithm:
     """
     A dumb algorithm doing nothing
     """
     #This is the 'juice' of the algorithm, the method 
     #where the actual optimzation is coded.
     def evolve(self, pop):
           return pop
     def get_name(self):
             return "Null Algorithm (Python)"
     def extra_info(self):
             return "Not much to add"

then:

algo = pygmo.algorithm(my_algorithm())

check the docs of pygmo.algorithm here: https://esa.github.io/pagmo2/docs/python/py_algorithm.html
and the docs of pygmo.population here:
https://esa.github.io/pagmo2/docs/python/py_population.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants