Closed DMGoldberg closed 12 years ago
Ooops, I deleted a comment then that was mostly nonsense due to a complete misreading of the message. Sorry Dave! (and @TallJimbo )
Alas, my misreading also means that now I have far less idea what the problem might be here, and so I throw the Issue out to the general populace. We are always keen to get more possible build scenarios under our belt.
Would it be possible to post the whole (or at least a chunk around the interesting bits of) the config.log file?
It'd be most helpful if you could:
A) delete .sconsign.dblite
B) delete config.log
C) try again, and post the new config.log
This failure actually seems familiar, but I can't remember what the problem was last time we saw it (and if it was identical, I'd think we'd have fixed the unhelpful error message). But I am concerned a little about the gcc version; Barney, do you know if we have any confirmed successes with Apple's gcc 4.0? It might be good to start compiling a matrix of platforms / dependency versions we know we've got things working on.
Can do. Here you go. Incidentally, I compiled successfully on my home machine, same OS, same versions of the various libraries, same procedure.
Thanks.
Dave
file /Users/goldberg/Downloads/GalSim-developers-GalSim-edd5d8e/SConstruct,line 997: Configure(confdir = .sconf_temp) scons: Configure: Checking for C++ library cfitsio... .sconf_temp/conftest_0.cpp <- |
---|
#include "fitsio.h" |
int |
main() { |
return 0; |
} |
g++ -o .sconf_temp/conftest_0.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include .sconf_temp/conftest_0.cpp g++ -o .sconf_temp/conftest_0 .sconf_temp/conftest_0.o -Llib -L/opt/local/lib -L/usr/local/lib -lcfitsio scons: Configure: yes
scons: Configure: Checking for C++ library fftw3... .sconf_temp/conftest_1.cpp <- |
---|
#include "fftw3.h" |
int |
main() { |
return 0; |
} |
g++ -o .sconf_temp/conftest_1.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include .sconf_temp/conftest_1.cpp g++ -o .sconf_temp/conftest_1 .sconf_temp/conftest_1.o -Llib -L/opt/local/lib -L/usr/local/lib -lcfitsio -lfftw3 scons: Configure: yes
scons: Configure: Checking for C++ header file boost/shared_ptr.hpp... .sconf_temp/conftest_2.cpp <- | #include <boost/shared_ptr.hpp> | |
---|---|---|
g++ -o .sconf_temp/conftest_2.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include .sconf_temp/conftest_2.cpp scons: Configure: yes
scons: Configure: Checking for C++ header file TMV.h... .sconf_temp/conftest_3.cpp <- | #include |
|
---|---|---|
g++ -o .sconf_temp/conftest_3.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include .sconf_temp/conftest_3.cpp scons: Configure: yes
scons: Configure: Checking for correct TMV linkage... .sconf_temp/conftest_4.cpp <- | #include "TMV_Sym.h" | int main() | { | //tmv::SymMatrix |
tmv::Matrix |
tmv::Matrix |
tmv::Matrix |
return 0; | } |
---|
g++ -o .sconf_temp/conftest_4.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include .sconf_temp/conftest_4.cpp .sconf_temp/conftest_5.cpp <- | #include "TMV_Sym.h" | int main() | { | //tmv::SymMatrix |
tmv::Matrix |
tmv::Matrix |
tmv::Matrix |
return 0; | } |
---|
g++ -o .sconf_temp/conftest_5.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include .sconf_temp/conftest_5.cpp g++ -o .sconf_temp/conftest_5 .sconf_temp/conftest_5.o -Llib -L/opt/local/lib -L/usr/local/lib -lcfitsio -lfftw3 -ltmv -lblas scons: Configure: yes
scons: Configure: Checking if we can build against Python... .sconf_temp/conftest_6.cpp <- | #include "Python.h" | int main() | { | Py_Initialize(); | Py_Finalize(); | return 0; | } |
---|
g++ -o .sconf_temp/conftest_6.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 .sconf_temp/conftest_6.cpp g++ -o .sconf_temp/conftest_6 .sconf_temp/conftest_6.o -Llib -L/opt/local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/Versions/2.7/lib -lcfitsio -lfftw3 -ltmv -lblas -lpython2.7 -ldl -framework CoreFoundation .sconf_temp/conftest_6 > .sconf_temp/conftest_6.out scons: Configure: yes
scons: Configure: Checking if we can build against NumPy... .sconf_temp/conftest_7.cpp <- | #include "Python.h" | #include "numpy/arrayobject.h" | void doImport() { | import_array(); | } | int main() | { | int result = 0; | Py_Initialize(); | doImport(); | if (PyErr_Occurred()) { | result = 1; | } else { | npy_intp dims = 2; | PyObject * a = PyArray_SimpleNew(1, &dims, NPY_INT); | if (!a) result = 1; | Py_DECREF(a); | } | Py_Finalize(); | return result; | } |
---|
g++ -o .sconf_temp/conftest_7.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include .sconf_temp/conftest_7.cpp g++ -o .sconf_temp/conftest_7 .sconf_temp/conftest_7.o -Llib -L/opt/local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/Versions/2.7/lib -lcfitsio -lfftw3 -ltmv -lblas -lpython2.7 -ldl -framework CoreFoundation .sconf_temp/conftest_8.cpp <- | #include "Python.h" | #include "numpy/arrayobject.h" | void doImport() { | import_array(); | } | int main() | { | int result = 0; | Py_Initialize(); | doImport(); | if (PyErr_Occurred()) { | result = 1; | } else { | npy_intp dims = 2; | PyObject * a = PyArray_SimpleNew(1, &dims, NPY_INT); | if (!a) result = 1; | Py_DECREF(a); | } | Py_Finalize(); | return result; | } |
---|
g++ -o .sconf_temp/conftest_8.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include .sconf_temp/conftest_8.cpp g++ -o .sconf_temp/conftest_8 .sconf_temp/conftest_8.o -Llib -L/opt/local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/Versions/2.7/lib -lcfitsio -lfftw3 -ltmv -lblas -lpython2.7 -ldl -framework CoreFoundation .sconf_temp/conftest_8 > .sconf_temp/conftest_8.out scons: Configure: yes
scons: Configure: Checking if we can build against Boost.Python... .sconf_temp/conftest_9.cpp <- | #include "boost/python.hpp" | |
---|---|---|
class Foo { public: Foo() {} }; | ||
int main() | ||
{ | ||
Py_Initialize(); | ||
boost::python::object obj; | ||
boost::python::class_< Foo >("Foo", boost::python::init<>()); | ||
Py_Finalize(); | ||
return 0; | ||
} | ||
g++ -o .sconf_temp/conftest_9.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include .sconf_temp/conftest_9.cpp
g++ -o .sconf_temp/conftest_9 .sconf_temp/conftest_9.o -Llib -L/opt/local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/Versions/2.7/lib -lcfitsio -lfftw3 -ltmv -lblas -lpython2.7 -ldl -framework CoreFoundation
Undefined symbols:
"boost::python::instance_holder::deallocate(object, void_)", referenced from:
boost::python::objects::make_holder<0>::applyboost::python::objects::valueholder<Foo, boost::mpl::vector0<mpl::na> >::execute(object)in conftest_9.o
"boost::python::objects::copy_class_object(boost::python::type_info const&, boost::python::type_info const&)", referenced from:
_main in conftest_9.o
"boost::python::objects::py_function_impl_base::~py_function_impl_base()", referenced from:
boost::python::objects::caller_py_functionimpl<boost::python::detail::caller<void ()(object), boost::python::default_call_policies, boost::mpl::vector2<void, object> > >::~caller_py_function_impl()in conftest_9.o
boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void ()(_object), boost::python::default_call_policies, boost::mpl::vector2<void, _object> > >::~caller_py_function_impl()in conftest_9.o
"boost::python::converter::shared_ptrdeleter::operator()(void const)", referenced from:
boost::detail::sp_counted_implpd<void, boost::python::converter::shared_ptr_deleter>::dispose()in conftest_9.o
boost::python::converter::shared_ptr_from_python |
#include "boost/python.hpp" | |
---|---|---|
class Foo { public: Foo() {} }; | ||
int main() | ||
{ | ||
Py_Initialize(); | ||
boost::python::object obj; | ||
boost::python::class_< Foo >("Foo", boost::python::init<>()); | ||
Py_Finalize(); | ||
return 0; | ||
} | ||
g++ -o .sconf_temp/conftest_10.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include .sconf_temp/conftest_10.cpp g++ -o .sconf_temp/conftest_10 .sconf_temp/conftest_10.o -Llib -L/opt/local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/Versions/2.7/lib -lboost_python -lcfitsio -lfftw3 -ltmv -lblas -lpython2.7 -ldl -framework CoreFoundation .sconf_temp/conftest_11.cpp <- | #include "boost/python.hpp" | |
---|---|---|
class Foo { public: Foo() {} }; | ||
int main() | ||
{ | ||
Py_Initialize(); | ||
boost::python::object obj; | ||
boost::python::class_< Foo >("Foo", boost::python::init<>()); | ||
Py_Finalize(); | ||
return 0; | ||
} | ||
g++ -o .sconf_temp/conftest_11.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -Iinclude -I/opt/local/include -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include .sconf_temp/conftest_11.cpp g++ -o .sconf_temp/conftest_11 .sconf_temp/conftest_11.o -Llib -L/opt/local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/Versions/2.7/lib -lboost_python -lcfitsio -lfftw3 -ltmv -lblas -lpython2.7 -ldl -framework CoreFoundation .sconf_temp/conftest_11 > .sconf_temp/conftest_11.out scons: Configure: no
Here's what I can tell so far:
-lboost_python
it succeeds, but we get some variety of segmentation fault when we actually try to run the program.When that's happened in the past, it's sometimes been because the version of some library (probably python2.x or boost_python) found by the runtime linker system (e.g. LD_LIBRARY_PATH) is different from the version picked up by the gcc linker (via -L options), so the versions of the two libraries weren't compatible at runtime. Do you have two versions of Python or Boost on your system?
If you're comfortable running .sconf_temp/conftest_11
in a debugger and can get the segmentation fault traceback, that also might be helpful.
I've also just opened a new issue (#127) to try to revamp how we do these configure checks; if we can't make progress here, that might give us something else to try.
My general policy is to always try the configuration "as is" before trying to add other things, as you say, expecting it to fail most of the time. The reason for it is in case people add explicit libraries with the EXTRA_LIBS option. If you have a non-standard set up, then you might need to just explicitly tell SCons what to use. In that case, we want to use those libraries rather than the ones that we think should work for normal set ups.
Maybe this isn't really necessary, but I don't think it's a huge time sink to do it that way.
Also, Dave, do a git pull and rerun scons. I'd had it set to remove the .scon* files to make sure they get remade after an error, but that means they're not around to diagnose problems. So I removed that "feature" (bug).
In reply to @TallJimbo, no I don't recall a successful case with gcc4.0. A table of successful/failed build cases is an excellent idea, I'll get working on a spreadsheet we can all share...
I just tested with g++ 4.0.1 and it worked fine, so I don't think that's the problem.
The only compiler that I've tried which I haven't fully gotten everything to work yet is icpc. It fails to find some stuff at run time when trying to load the galsim library. I think I got it to work by setting LD_LIBRARY_PATH, but that's an inelegant solution. I didn't make an issue for it, but I guess I probably should. It's not the machine I usually use, so it hasn't been high priority for me, and I don't think anyone else is using icpc.
I spoke too soon. Turns out scons tests failed for 4.0, but I just fixed it.
Dave, another thing that could possibly be the problem is that on my computer the g++-4.0 compiler defaults to compiling 32 bit code, and the python version that comes with the computer is 64 bit, and thus needs 64 bit libraries. If this is true on your computer too, then that could possibly be the problem. (Although for whatever reason, the clash didn't show up on my computer until I ran scons tests, so maybe not.)
Anyway, to check this you could try running:
scons EXTRA_FLAGS=-m64
and see if that works.
At Mike's suggestion, I checked out the latest version of of GalSim (GalSim-developers-GalSim-5088ebd.tar). The previous version (GalSim-developers-GalSim-edd5d8e.tar) did not save the .sconf_temp/ directory.
However, now I find that my build fails even earlier, at the TMV stage. I have tried manually including a TMV_DIR flag, but that doesn't seem to be the issue. I should note that I use gcc 4.0.1 both at work and at home (where I compiled successfully). My current log is below.
Thoughts and suggestions are, of course, appreciated.
Dave
file /Users/goldberg/Desktop/GalSim-developers-GalSim-5088ebd/SConstruct,line 1003: Configure(confdir = .sconf_temp) scons: Configure: Checking for C++ library cfitsio... .sconf_temp/conftest_0.cpp <- |
---|
#include "fitsio.h" |
int |
main() { |
return 0; |
} |
g++ -o .sconf_temp/conftest_0.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -m64 -Iinclude -I/usr/local/include -I/opt/local/include .sconf_temp/conftest_0.cpp g++ -o .sconf_temp/conftest_0 -m64 .sconf_temp/conftest_0.o -Llib -L/usr/local/lib -L/opt/local/lib -lcfitsio ld warning: in /usr/local/lib/libcfitsio.a, file is not of required architecture scons: Configure: yes
scons: Configure: Checking for C++ library fftw3... .sconf_temp/conftest_1.cpp <- |
---|
#include "fftw3.h" |
int |
main() { |
return 0; |
} |
g++ -o .sconf_temp/conftest_1.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -m64 -Iinclude -I/usr/local/include -I/opt/local/include .sconf_temp/conftest_1.cpp g++ -o .sconf_temp/conftest_1 -m64 .sconf_temp/conftest_1.o -Llib -L/usr/local/lib -L/opt/local/lib -lcfitsio -lfftw3 ld warning: in /usr/local/lib/libcfitsio.a, file is not of required architecture ld warning: in /opt/local/lib/libfftw3.dylib, file is not of required architecture scons: Configure: yes
scons: Configure: Checking for C++ header file boost/shared_ptr.hpp... .sconf_temp/conftest_2.cpp <- | #include <boost/shared_ptr.hpp> | |
---|---|---|
g++ -o .sconf_temp/conftest_2.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -m64 -Iinclude -I/usr/local/include -I/opt/local/include .sconf_temp/conftest_2.cpp scons: Configure: yes
scons: Configure: Checking for C++ header file TMV.h... .sconf_temp/conftest_3.cpp <- | #include |
|
---|---|---|
g++ -o .sconf_temp/conftest_3.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -m64 -Iinclude -I/usr/local/include -I/opt/local/include .sconf_temp/conftest_3.cpp scons: Configure: yes
scons: Configure: Checking for correct TMV linkage... .sconf_temp/conftest_4.cpp <- | #include "TMV_Sym.h" | int main() | { | //tmv::SymMatrix |
tmv::Matrix |
tmv::Matrix |
tmv::Matrix |
return 0; | } |
---|
g++ -o .sconf_temp/conftest_4.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -m64 -Iinclude -I/usr/local/include -I/opt/local/include .sconf_temp/conftest_4.cpp .sconf_temp/conftest_5.cpp <- | #include "TMV_Sym.h" | int main() | { | //tmv::SymMatrix |
tmv::Matrix |
tmv::Matrix |
tmv::Matrix |
return 0; | } |
---|
g++ -o .sconf_temp/conftest_5.o -c -O2 -fno-strict-aliasing -g3 -Wall -Werror -m64 -Iinclude -I/usr/local/include -I/opt/local/include .sconf_temp/conftest_5.cpp
g++ -o .sconf_temp/conftest_5 -m64 .sconf_temp/conftest_5.o -Llib -L/usr/local/lib -L/opt/local/lib -lcfitsio -lfftw3 -ltmv -lblas
ld warning: in /usr/local/lib/libcfitsio.a, file is not of required architecture
ld warning: in /opt/local/lib/libfftw3.dylib, file is not of required architecture
ld warning: in /usr/local/lib/libtmv.dylib, file is not of required architecture
Undefined symbols:
"tmv::DivHelperstd::complex |
---|
Greetings, all. I haven't seen this problem yet, but hopefully it has an easy fix. I am compiling GalSim on a Mac (10.5.8) using Python 2.7. I installed Boost from source, and tested afterwards with:
otool -L /usr/local/lib/libboost_python.dylib /usr/local/lib/libboost_python.dylib: libboost_python.dylib (compatibility version 0.0.0, current version 0.0.0) /Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.5)
which I interpret as a good thing.
However, upon running:
I get:
scons: Reading SConscript files ... SCons is version 2.1.0 using python version 2.7.1 Python is from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 Using compiler: /usr/bin/g++ compiler version: 4.0.1 Determined that a good number of jobs = 2 Checking for C++ library cfitsio... yes Checking for C++ library fftw3... yes Checking for C++ header file boost/shared_ptr.hpp... yes Checking for C++ header file TMV.h... yes Using TMV_LINK file: /usr/local/share/tmv/tmv-link -ltmv -lblas Checking for correct TMV linkage... (this may take a little while) Checking for correct TMV linkage... yes Checking if we can build against Python... yes Checking if we can build against NumPy... yes sh: line 1: 40620 Bus error .sconf_temp/conftest_11 > ".sconf_temp/conftest_11.out" Checking if we can build against Boost.Python... no Cannot run program built with Boost.Python.
Please fix the above error(s) and rerun scons
which doesn't seem terribly helpful. The bus error is particularly confusing.
I've looked in the config.log file, and while there are a few hints, I'm not sure what to make of them. In particular:
boost::python::converter::as_to_python_function<Foo, boost::python::objects::class_cref_wrapper<Foo, boost::python::objects::make_instance<Foo, boost::python::objects::value_holder > > >::convert(void const*)in conftest_9.o
ld: symbol(s) not found
Though as I'm not an expert in boost, I've no idea what to make of this.
Any suggestions?
Thanks,
Dave