-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snopt library cannot be loaded. #2
Comments
This is not a crash. The program throws as you library is either not found (and this seems not to be the case) or it does not contain an API compatible with our plugin. Can you post the result of
|
ldd libsnopt7_c.so
linux-vdso.so.1 => (0x00007ffe5a5ab000)
libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3
(0x00007fe1649a9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe1645df000)
libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0
(0x00007fe1643a0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe164097000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007fe163e81000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe164ee2000)
…On Fri, Sep 7, 2018 at 5:42 AM Dario Izzo ***@***.***> wrote:
THis is not a crash. The program throws as you library is either not found
(and this seems not to be the case) or it does not contain an API
compatible with our plugin.
Where did you take the library? Have you compiled it yourself?
Can you post the result of ldd on your snopt7_c library?
ldd libsnopt7_c.so
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADbqdFD6u0QIQYTzxRWHo7-AAbJLUXDZks5uYj-QgaJpZM4WeDfV>
.
|
Where is the library taken from? Do you compile it yourself? What version of SNOPT is this? |
This was downloaded directly from the website. I did not compile it myself.
v2.1.0 for SNOPT 7.7
…On Fri, Sep 14, 2018 at 3:14 AM Dario Izzo ***@***.***> wrote:
Where is the library taken from? Do you compile it yourself? What version
of SNOPT is this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADbqdJZTH3P5rr6T0gaKL0kZIa3r6Uwnks5ua1dRgaJpZM4WeDfV>
.
|
What is needed is for pagmo_plugins to work is the snopt7_c library to containing the following symbols:
which I think it does (you can check easily). Looking at your error message "undefined symbol: snstop_" it seems your library is not finding a different symbol when loaded in memory ( It is also weird for me that your library does not link to the fortran library. The way I usually install snopt7 is to get the fortran library and then compile snopt7_c from https://github.com/snopt/snopt-interface. If I were you I would try. On my system the libsnopt7_c.so library links also to the fortran library libsnopt7.so I am curious to try and fix this issue, so if you need help ask here. |
How can I check that I have those symbols?
…On Fri, Sep 14, 2018 at 1:48 PM Dario Izzo ***@***.***> wrote:
Looking better at your error message "*undefined symbol: snstop_*" it
seems your library is not finding a symbol when loaded in memory. Does not
look as a problem with pagmo_plugins_non_free, rather with the *snopt7*
libraries you have downloaded. If you have the symbols above (which I think
its likely at this point), I would try to contact them and ask why their
library cannot be loaded having that symbol missing.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADbqdNNazw8A3HM9Vo8u7bguYuOr_LPfks5ua-vqgaJpZM4WeDfV>
.
|
I am not currently in a linux system, but the following command should give you the list:
|
On my OSX this is the result:
|
Here is the result:
```bash
nm -D libsnopt7_c.so
...
000000000020b360 B __snopt_wrapper_MOD_cw
U snset_
U snseti_
U snsetr_
U snspec_
U snspecf_
U snstop_
...
```
|
You see that the required symbols are there defining the correct API version. |
On my fortran library instead I have:
as you see there I have the symbol snstop_ you are missing and that is probably used by the snopt7_c library. |
Can you format your symbol list with markdown please? Anyhow, as you see from your list the line:
says that the library needs the symbol snstop_ but its undefined. As a consequence that library will only work if when loaded in memory, the fortran library that defines that symbol has already been loaded. |
It seems to me your snopt7_c library should be linked to the fortran library |
Is there a way to manually link them?
|
If you do have the snopt library (should be called libsnopt7.so under linux), then download for github and compile the project https://github.com/snopt/snopt-interface That project will create the libsnopt7_c.so library and link it to the libsnopt7.so library. |
I'm sorry for so many questions. I'm a little confused. There does not
appear to be a way to build snopt-interface as a library (or at least no
insructions to do so) there, all I see is a way to build binary
optimization programs that link to existing .so files.
Am I missing something?
|
Download the code in a folder using
the library will be created in the folder snopt-interface/lib and it will link to your libsnopt7.so library (which must be found by the system otherwise will appear as missing) |
Sorry for the extreme ignroance here. Still cannot build that library. Why would I get this? $ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... mawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgfortran... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking for nagfor... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking whether we are using the GNU Fortran compiler... no
checking whether accepts -g... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking how to get verbose linking output from ... configure: WARNING: compilation failed
checking for Fortran libraries of ...
checking Fortran 90 module output flag... unknown
checking Fortran 90 module inclusion flag... unknown
checking for C interface... yes
checking for C++ interface... yes
sed: can't read confdefs.h: No such file or directory
configure: creating ./config.status
config.status: error: cannot find input file: `Makefile.in' |
This seems to be a problem with your linux system. Have you ever built anything successfully in your linux? If not you might be missing dev. packages to allow and build code. You need to have a system that is able to build succesfully code using the standard toolchain of autoconf. If you have a linux system with apt-get, try:
|
I am trying to build SNOPT with the PaGMO interface in Windows. Do you know if pagmo requires a the snopt7 library to be a .so file? Currently when I build SNOPT from source using MinGW with shared libraries enabled, it gives me a .dll file. |
.dll is fine. As far as all its dependenies are also found. When building with mingw you need to make all the mingw related libraries also be found. (you can use dependency walker to know what the dll needs) |
I would be interested to know if you succeed. Can you post here any progress? |
Sure, I'm curious if you have SNOPT currently working with this interface. Additionally, I'm trying to determine whether to use the 64-bit MinGW toolkit or the 32-bit one. Do you have any insight on this? |
Yes the code is tested and work beautifully with my version of SNOPT7 (I have the source files). Here is how I do it:
I used both 32 and 64 to do the above "chain" and produce the dlls. |
I am working to a new interface compatible with snopt 77, see #6, in case it affects you |
The PR #7 introduces the possibility of specifying the snopt api to be used and has been tested on 7.7 (evaluation copy from the snopt web site). Let me know if it works for you too. |
I close the issue, if a problem is found with the new code open a new issue. |
@darioizzo Sorry for the late response. Had been working on other projects. I have built the fortran libraries for SNOPT in 64bit using MSYS2 toolkit. The C interface has also been compiled and linked. I don't know how to check a dll to see what symbol it contains. I have also installed pyGMO and pygmo_plugins_nonfree using pip for Python 3. Just have to test and see if I can call SNOPT correctly. |
I will open a new issue if I run into problems |
You can check the dll needed by the dll you compiled using "dependency walker", a small software useful in this case. When compiling with minGW the dll of snopt will require a number of mingw dll that, if not found, will give you problems. |
I am also experiencing the same configure error that @aespielberg reported while trying to install the snopt-interface: |
seems a problem of interaction between your environment and snopt-interface, maybe raise the issue there? (https://github.com/snopt/snopt-interface) |
I experienced the same error as @aespielberg. The key to fixing the issue was to use the specific commit that @darioizzo references. I tried several of the releases from snopt-interface with no luck. |
I am simply trying to run the example as written. However, when I try to run evolve, I get the following error:
What is the cause of this? libsnopt7_c.so is exactly where it is pointed.
The text was updated successfully, but these errors were encountered: