Skip to content
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

build error on Cygwin #12

Open
BAM-BAM-BAM opened this issue Sep 11, 2011 · 6 comments
Open

build error on Cygwin #12

BAM-BAM-BAM opened this issue Sep 11, 2011 · 6 comments

Comments

@BAM-BAM-BAM
Copy link

I'm trying to build arac on cygwin/Window 7 64-bit.

This is the error I eventually get when using scons:

g++ -o test-arac.exe src/cpp/tests/test_datasets.o src/cpp/tests/test_main.o src/cpp/tests/test_optimzation.o src/cpp/tests/test_structure.o src/cpp/tests/test_utilities.o -L/usr/lib -L. -L/usr/local/lib -L/sw/lib -larac -lgtest
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -larac
collect2: ld returned 1 exit status
scons: *** [test-arac.exe] Error 1
scons: building terminated because of errors.

... so g++ can't find the arac library ... and I can't either.

Here are the lines in the SConstruct that are asking for the arac library:

testenv = Environment(LIBS=['arac', 'gtest'], CPPPATH=CPPPATH, LIBPATH=LIBPATH)
test = testenv.Program('test-arac', Glob('src/cpp/tests/*.cpp'))

libarac.so is successfully being generated earlier in the build process.

any ideas on how to get around this problem?

thanks!

@BAM-BAM-BAM
Copy link
Author

I renamed libarac.so to libarac.dll it helped g++ find the library, but I guess the library exports aren't working.

$ g++ -o src/python/arac/_cppbridge.so -shared src/swig/cppbridge_wrap.os -L/usr/lib -L. -L/usr/local/lib -L/sw/lib -larac
src/swig/cppbridge_wrap.os:cppbridge_wrap.cc:(.text+0x9db): undefined reference to `_PyString_AsString'
src/swig/cppbridge_wrap.os:cppbridge_wrap.cc:(.text+0x9ee): undefined reference to `_PyString_FromString'
src/swig/cppbridge_wrap.os:cppbridge_wrap.cc:(.text+0xa1a): undefined reference to `__imp__PyExc_MemoryError'
 ... many more undefined references ...

@BAM-BAM-BAM
Copy link
Author

fixed the undefined reference errors by adding python2.6 as a lib dependency in my local SConstruct file; not sure if it's a problem with my environment or not otherwise I would change the project's file.

@bayerj
Copy link
Owner

bayerj commented Sep 15, 2011

You have to make sure that libarac.so is found. For that, it needs to
either be in /usr/local/lib or /sw/lib -- see the -L options in the
g++ line.

I recommend you do that by creating a symbolic link. See the 2nd point
at https://github.com/bayerj/arac/wiki/Installation.

On 11 September 2011 23:48, BAM-BAM-BAM
[email protected]
wrote:

I'm trying to build arac on cygwin/Window 7 64-bit.

This is the error I eventually get when using scons:

   g++ -o test-arac.exe src/cpp/tests/test_datasets.o src/cpp/tests/test_main.o src/cpp/tests/test_optimzation.o src/cpp/tests/test_structure.o src/cpp/tests/test_utilities.o -L/usr/lib -L. -L/usr/local/lib -L/sw/lib -larac -lgtest
   /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -larac
   collect2: ld returned 1 exit status
   scons: *** [test-arac.exe] Error 1
   scons: building terminated because of errors.

... so g++ can't find the arac library ... and I can't either.

Here are the lines in the SConstruct that are asking for the arac library:

   testenv = Environment(LIBS=['arac', 'gtest'], CPPPATH=CPPPATH, LIBPATH=LIBPATH)
   test = testenv.Program('test-arac', Glob('src/cpp/tests/*.cpp'))

libarac.so is successfully being generated earlier in the build process.

any ideas on how to get around this problem?

thanks!

Reply to this email directly or view it on GitHub:
#12

Dipl. Inf. Justin Bayer
Lehrstuhl für Robotik und Echtzeitsysteme, Technische Universität München
http://www6.in.tum.de/Main/Bayerj

@BAM-BAM-BAM BAM-BAM-BAM reopened this Sep 18, 2011
@BAM-BAM-BAM
Copy link
Author

unfortunately I don't think it's that easy.

I'm using the Windows python2.7 binary, since it was fairly easy to get scipy installed and running with it. I had tried to use the python packaged with cygwin, but after a couple of days gave up on it since I could not get scipy compiled with it.

Since I'm using the Windows version of python, I think libarac must be compiled as a .dll or .pyd. And this seems difficult since it seem like I would have to come up with all new project files, dependencies, etc. (i.e. throw away the entire build/make code that comes with arac.)

I did try symbolic links, copying the file to multiple locations (/usr/local/lib, /usr/lib) etc. The library, when renamed to libarac.dll or libarac.pyd was found by the linker but I just couldn't get it to resolve all the link references.

So I haven't figure out how to build for Wndows/cygwin yet; I'm just using slow networks :(

@bayerj
Copy link
Owner

bayerj commented Sep 18, 2011

I have no experience making arac run on windows. I also do not have
access to a windows machine to try things out - so I fear you are on
you own.

You can try the PyBrian mailinglist (see http://pybrain.org for more
info). Let me know if you succeed.

On 18 September 2011 02:11, BAM-BAM-BAM
[email protected]
wrote:

unfortunately I don't think it's that easy.

I'm using the Windows python2.7 binary, since it was fairly easy to get scipy installed and running with it.  I had tried to use the python packaged with cygwin, but after a couple of days gave up on it since I could not get scipy compiled with it.

Since I'm using the Windows version of python, I think libarac must be compiled as a .dll or .pyd.  And this seems difficult since it seem like I would have to come up with all new project files, dependencies, etc. (i.e. throw away the entire build/make code that comes with arac.)

I did try symbolic links, copying the file to multiple locations (/usr/local/lib, /usr/lib) etc.  The library, when renamed to libarac.dll or libarac.pyd was found by the linker but I just couldn't get it to resolve all the link references.

So I haven't figure out how to build for Wndows/cygwin yet; I'm just using slow networks :(

Reply to this email directly or view it on GitHub:
#12 (comment)

Dipl. Inf. Justin Bayer
Lehrstuhl für Robotik und Echtzeitsysteme, Technische Universität München
http://www6.in.tum.de/Main/Bayerj

@agcala
Copy link

agcala commented Nov 20, 2019

Try the following

libenv = Environment(target='libarac.dll',LIBS=['libblas','msvcrt'], CPPPATH=CPPPATH, LIBPATH=LIBPATH,
         SHLIBPREFIX="", CCFLAGS=CCFLAGS)

That would resolve your link references. Be sure you have BLAS installed and on path and that msvcrt.dll is on path.

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

No branches or pull requests

3 participants