rice-solar-physics/ebtelplusplus

scons failure

adamrkob opened this issue · 24 comments

Good day,

Sorry for such a potentially trivial issue, but I could not get scons to succeed. This is in the standard installation method. I have checked all other dependencies that I can find, including the optional apolloDB (though just used git to grab the directories). I have restarted to verify that it is not a system setup issue. It may be a dependency distinct to my system, but since I am unfamiliar with many parts of the setup, I was hoping you could assist and assumed others may face the same problems.

I am currently using python 2.7 on a macbook pro from mid 2014 running os x 10.11.6 .

The output is below. (the machine name is canty, and it failed similarly with both bash and tcsh).

Are you able to help me track this problem down? I will continue to search for a solution, but you may have seen this type of issue previously.

Thanks,

Adam

canty% cd work/high_cad_xrt/ebtelPlusPlus/
canty% scons
scons: Reading SConscript files ...
Using Mac OS X compile options.
Compiling ebtel++
scons: done reading SConscript files.
scons: Building targets ...
g++ -o bin/ebtel++.run Radiation_Model/source/element.o Radiation_Model/source/ionfrac.o Radiation_Model/source/radiation.o Radiation_Model/source/OpticallyThick/OpticallyThickIon.o rsp_toolkit/source/file.o rsp_toolkit/source/fitpoly.o rsp_toolkit/source/xmlreader.o rsp_toolkit/tinyxml2/tinyxml2.o source/dem.o source/heater.o source/loop.o source/main.o source/observer.o -L/opt/local/lib -lboost_program_options-mt
Undefined symbols for architecture x86_64:
"boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)", referenced from:
boost::program_options::basic_command_line_parser::basic_command_line_parser(int, char const* const*) in main.o
"boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned int, unsigned int)", referenced from:
_main in main.o
"boost::program_options::arg[abi:cxx11]", referenced from:
boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char>::name() const in main.o
"boost::program_options::detail::cmdline::cmdline(std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&)", referenced from:
boost::program_options::basic_command_line_parser::basic_command_line_parser(int, char const* const*) in main.o
"boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >*, int)", referenced from:
boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&) const in main.o
"boost::program_options::operator<<(std::basic_ostream<char, std::char_traits >&, boost::program_options::options_description const&)", referenced from:
_main in main.o
"boost::program_options::abstract_variables_map::operator[](std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const", referenced from:
_main in main.o
"boost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > const&, bool) const", referenced from:
vtable for boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char> in main.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
scons: *** [bin/ebtel++.run] Error 1
scons: building terminated because of errors.

canty% python
Python 2.7.13 (default, Dec 18 2016, 05:35:35)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

exit()

It looks like scons is having a hard time finding the boost libraries that it uses for parsing command line arguments. Have you installed these and if so how?

I originally used homebrew to install the libraries. After that failed, I tried to reinstall using macports. The homebrew boost is version 1.63.0, while macports installed v 1.59.0_2. After your response, I just attempted to install it from scratch (which appeared to succeed), but it didn't help (though that could be due to a lot of factors). As a quick check, I could not find which 'boost' was being used via the 'which boost' command (which found nothing), which could suggest I have a lingering path issue (though other brew and port installed programs work) though I do not know if boost is actually a command line tool, since this is my first direct experience with it. Is there a handy way to direct scons and others to the directory of boost related tools? --includepath did not help.

Boost doesn't install any executables so you won't be able to find it using which.

So you've installed it using homebrew? If so, it's possible that the linking step is failing because the default links I've included in the scons file are for a Macports install of boost. I should probably modify these defaults or print a message to make it really explicit where it is trying to find these links...

From what I understand, brew installs libraries to /usr/local/lib and headers to /usr/local/include. To modify where scons will look for the boost libraries, you'll need to adjust the libpath as well. So with the Boost libraries installed with Homebrew, I would try

$ scons --includepath /usr/local/include --libpath /usr/local/lib

The --includepath flag will make sure that you can find the needed headers as well. Also, double check to make sure the Boost program_options library is in /usr/local/lib.

Thanks!

TL;DR: the problem does not seem to be a macports/brew problem. The closest match to program_options is libboost_program_options-mt.dylib . I am now using macports primarily for this (there are likely some unrelated programs involved that I have installed via brew).

OK, so I uninstalled macports boost, then reinstalled boost via brew and tried the line above (Thank you!). That provided a different error, that it could not find malloc.h (even though I could find the expected malloc.h in /usr/include/malloc as suggested on forums and the SConstruct script).

So assuming that using the include libraries clobbered searching that directory, I attempted to remove all signs of boost from /usr/lib/ (anything with libboost). I then reinstalled from macports, rebooted. To avoid further confusion until this is resolved, I will only use the macports version.

I then re grabbed the files via git (to make sure it wasn't a lingering file issue) and retried as normal. This failed in the way previously stated. When I then used the -includepath and libpath commands to point to the macports versions directly, I got the same malloc.h error I got when using the brew version of boost (shown below). By also adding in a direct link to /usr/local/malloc in the call returned to the error message from the first thread. I verified that libboost_program_options-mt.dylib is in /opt/local/lib/ . Could the '-mt' be throwing it off?

canty% scons --includepath=/opt/local/include --libpath=/opt/local/lib
scons: Reading SConscript files ...
Using Mac OS X compile options.
Compiling ebtel++
scons: done reading SConscript files.
scons: Building targets ...
g++ -o Radiation_Model/source/OpticallyThick/OpticallyThickIon.o -c -std=c++11 -O3 -I/opt/local/include Radiation_Model/source/OpticallyThick/OpticallyThickIon.cpp
Radiation_Model/source/OpticallyThick/OpticallyThickIon.cpp:15:20: fatal error: malloc.h: No such file or directory
 #include <malloc.h>
                    ^
compilation terminated.
scons: *** [Radiation_Model/source/OpticallyThick/OpticallyThickIon.o] Error 1
scons: building terminated because of errors.

Ah yes ok. Sorry, I messed up when I sent you that scons line previously. It should be,

$ scons --includepath=/usr/local/include,/usr/include/malloc --libpath=/usr/local/lib

(Note: you can pass as many things to libpath and includepath as you want, separated by commas)
That line above is if you are using Homebrew. If you are now using Macports, you should be able to compile by just running scons.

This malloc.h issue is something Mac-specific and I have no idea why it isn't just in /usr/include. Basically what happened is that in the default Mac compile flags, this is included correctly but when you pass in custom include and libpaths, those defaults are overwritten so you then have to pass the malloc flag explicitly.

The "-mt" (for multi-threaded, for some reason these are built this way on Mac, but not Linux...) is already accounted for in the default Mac options so this shouldn't be a problem.

Sounds good, though I forget to mention specifically that when I include the malloc addition, I got back to the error from the original thread. I will attempt to install it on my ubuntu laptop to verify that all is well there (though I hope to get it working on my macs as they are more powerful in pretty much all respects to my linux laptop). I will look deeper to see if there are lingering issues with OSX boost that I can solve. Can you verify what versions of boost you have had success with (in case there were depricated changes)?
For notekeeping, I will remind myself

The homebrew boost is version 1.63.0, while macports installed v 1.59.0_2

Hmm that's strange...

Ok looking back at your output before, seems that it was never able to find the boost libraries. Not having the malloc include path was just preventing it from getting to the linking step. This is why you get the same error message now that you can find malloc.h.

It may help to clean your installation between attempts just to make sure any stale files aren't messing anything up. Do this by running

$ scons -c

If you've installed boost with macports, I cannot see why just the default $ scons command isn't working...try uninstalling and reinstalling boost on macports and verifying that libboost_program_options-mt.dylib is in /opt/local/lib.

For reference, on my mid-2009 Macbook Pro, running

$ port installed | grep boost

gives

boost @1.59.0_2+no_single+no_static+python27 (active)

OK, so I think my previous error message may be misleading. That is the error message the second time scons is run. The first time, other errors exist.

canty% cd ebtelPlusPlus/
canty% ls
LICENSE          SConstruct       docs/            source/
README.md        bin/             examples/        test/
Radiation_Model/ config/          rsp_toolkit/
canty% scons
scons: Reading SConscript files ...
Using Mac OS X compile options.
Compiling ebtel++
scons: done reading SConscript files.
scons: Building targets ...
g++ -o Radiation_Model/source/OpticallyThick/OpticallyThickIon.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc Radiation_Model/source/OpticallyThick/OpticallyThickIon.cpp
g++ -o Radiation_Model/source/element.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc Radiation_Model/source/element.cpp
g++ -o Radiation_Model/source/ionfrac.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc Radiation_Model/source/ionfrac.cpp
g++ -o Radiation_Model/source/radiation.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc Radiation_Model/source/radiation.cpp
g++ -o rsp_toolkit/source/file.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc rsp_toolkit/source/file.cpp
g++ -o rsp_toolkit/source/fitpoly.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc rsp_toolkit/source/fitpoly.cpp
g++ -o rsp_toolkit/source/xmlreader.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc rsp_toolkit/source/xmlreader.cpp
g++ -o rsp_toolkit/tinyxml2/tinyxml2.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc rsp_toolkit/tinyxml2/tinyxml2.cpp
/var/tmp//ccT3fXZv.s:4:11: warning: section "__textcoal_nt" is deprecated
        .section __TEXT,__textcoal_nt,coalesced,pure_instructions
                 ^      ~~~~~~~~~~~~~

which continues for ~1000 lines, followed by

g++ -o source/heater.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc source/heater.cpp
/var/tmp//cczB52MT.s:244:11: warning: section "__textcoal_nt" is deprecated
        .section __TEXT,__textcoal_nt,coalesced,pure_instructions
                 ^      ~~~~~~~~~~~~~

which continues for ~10 lines, followed by

g++ -o source/loop.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc source/loop.cpp
/var/tmp//cccjUcMo.s:4:11: warning: section "__textcoal_nt" is deprecated
        .section __TEXT,__textcoal_nt,coalesced,pure_instructions
                 ^      ~~~~~~~~~~~~~

which continues for ~57 lines, followed by

g++ -o source/main.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc source/main.cpp
In file included from /opt/local/include/boost/smart_ptr/shared_ptr.hpp:28:0,
                 from /opt/local/include/boost/shared_ptr.hpp:17,
                 from /opt/local/include/boost/program_options/options_description.hpp:16,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/opt/local/include/boost/smart_ptr/detail/shared_count.hpp:396:33: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
     explicit shared_count( std::auto_ptr<Y> & r ): pi_( new sp_counted_impl_p<Y>( r.get() ) )
                                 ^
In file included from /usr/local/include/c++/5.1.0/memory:81:0,
                 from /opt/local/include/boost/function/function_base.hpp:16,
                 from /opt/local/include/boost/function/detail/prologue.hpp:17,
                 from /opt/local/include/boost/function/function_template.hpp:13,
                 from /opt/local/include/boost/function/detail/maybe_include.hpp:18,
                 from /opt/local/include/boost/function/function1.hpp:11,
                 from /opt/local/include/boost/program_options/value_semantic.hpp:13,
                 from /opt/local/include/boost/program_options/options_description.hpp:13,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/usr/local/include/c++/5.1.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from /opt/local/include/boost/shared_ptr.hpp:17:0,
                 from /opt/local/include/boost/program_options/options_description.hpp:16,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:249:65: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
 template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R >
                                                                 ^
In file included from /usr/local/include/c++/5.1.0/memory:81:0,
                 from /opt/local/include/boost/function/function_base.hpp:16,
                 from /opt/local/include/boost/function/detail/prologue.hpp:17,
                 from /opt/local/include/boost/function/function_template.hpp:13,
                 from /opt/local/include/boost/function/detail/maybe_include.hpp:18,
                 from /opt/local/include/boost/function/function1.hpp:11,
                 from /opt/local/include/boost/program_options/value_semantic.hpp:13,
                 from /opt/local/include/boost/program_options/options_description.hpp:13,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/usr/local/include/c++/5.1.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from /opt/local/include/boost/shared_ptr.hpp:17:0,
                 from /opt/local/include/boost/program_options/options_description.hpp:16,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:448:31: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
     explicit shared_ptr( std::auto_ptr<Y> & r ): px(r.get()), pn()
                               ^
In file included from /usr/local/include/c++/5.1.0/memory:81:0,
                 from /opt/local/include/boost/function/function_base.hpp:16,
                 from /opt/local/include/boost/function/detail/prologue.hpp:17,
                 from /opt/local/include/boost/function/function_template.hpp:13,
                 from /opt/local/include/boost/function/detail/maybe_include.hpp:18,
                 from /opt/local/include/boost/function/function1.hpp:11,
                 from /opt/local/include/boost/program_options/value_semantic.hpp:13,
                 from /opt/local/include/boost/program_options/options_description.hpp:13,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/usr/local/include/c++/5.1.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from /opt/local/include/boost/shared_ptr.hpp:17:0,
                 from /opt/local/include/boost/program_options/options_description.hpp:16,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:461:22: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
     shared_ptr( std::auto_ptr<Y> && r ): px(r.get()), pn()
                      ^
In file included from /usr/local/include/c++/5.1.0/memory:81:0,
                 from /opt/local/include/boost/function/function_base.hpp:16,
                 from /opt/local/include/boost/function/detail/prologue.hpp:17,
                 from /opt/local/include/boost/function/function_template.hpp:13,
                 from /opt/local/include/boost/function/detail/maybe_include.hpp:18,
                 from /opt/local/include/boost/function/function1.hpp:11,
                 from /opt/local/include/boost/program_options/value_semantic.hpp:13,
                 from /opt/local/include/boost/program_options/options_description.hpp:13,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/usr/local/include/c++/5.1.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from /opt/local/include/boost/shared_ptr.hpp:17:0,
                 from /opt/local/include/boost/program_options/options_description.hpp:16,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:538:34: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
     shared_ptr & operator=( std::auto_ptr<Y> & r )
                                  ^
In file included from /usr/local/include/c++/5.1.0/memory:81:0,
                 from /opt/local/include/boost/function/function_base.hpp:16,
                 from /opt/local/include/boost/function/detail/prologue.hpp:17,
                 from /opt/local/include/boost/function/function_template.hpp:13,
                 from /opt/local/include/boost/function/detail/maybe_include.hpp:18,
                 from /opt/local/include/boost/function/function1.hpp:11,
                 from /opt/local/include/boost/program_options/value_semantic.hpp:13,
                 from /opt/local/include/boost/program_options/options_description.hpp:13,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/usr/local/include/c++/5.1.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from /opt/local/include/boost/shared_ptr.hpp:17:0,
                 from /opt/local/include/boost/program_options/options_description.hpp:16,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:547:34: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
     shared_ptr & operator=( std::auto_ptr<Y> && r )
                                  ^
In file included from /usr/local/include/c++/5.1.0/memory:81:0,
                 from /opt/local/include/boost/function/function_base.hpp:16,
                 from /opt/local/include/boost/function/detail/prologue.hpp:17,
                 from /opt/local/include/boost/function/function_template.hpp:13,
                 from /opt/local/include/boost/function/detail/maybe_include.hpp:18,
                 from /opt/local/include/boost/function/function1.hpp:11,
                 from /opt/local/include/boost/program_options/value_semantic.hpp:13,
                 from /opt/local/include/boost/program_options/options_description.hpp:13,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/usr/local/include/c++/5.1.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from /opt/local/include/boost/shared_ptr.hpp:17:0,
                 from /opt/local/include/boost/program_options/options_description.hpp:16,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/opt/local/include/boost/smart_ptr/shared_ptr.hpp: In member function 'boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&&)':
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:549:38: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
         this_type( static_cast< std::auto_ptr<Y> && >( r ) ).swap( *this );
                                      ^
In file included from /usr/local/include/c++/5.1.0/memory:81:0,
                 from /opt/local/include/boost/function/function_base.hpp:16,
                 from /opt/local/include/boost/function/detail/prologue.hpp:17,
                 from /opt/local/include/boost/function/function_template.hpp:13,
                 from /opt/local/include/boost/function/detail/maybe_include.hpp:18,
                 from /opt/local/include/boost/function/function1.hpp:11,
                 from /opt/local/include/boost/program_options/value_semantic.hpp:13,
                 from /opt/local/include/boost/program_options/options_description.hpp:13,
                 from /opt/local/include/boost/program_options.hpp:15,
                 from source/main.cpp:7:
/usr/local/include/c++/5.1.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^

which continues for ~1900 lines, followed by

g++ -o source/observer.o -c -std=c++11 -O3 -I/opt/local/include -I/usr/include/malloc source/observer.cpp
g++ -o bin/ebtel++.run Radiation_Model/source/element.o Radiation_Model/source/ionfrac.o Radiation_Model/source/radiation.o Radiation_Model/source/OpticallyThick/OpticallyThickIon.o rsp_toolkit/source/file.o rsp_toolkit/source/fitpoly.o rsp_toolkit/source/xmlreader.o rsp_toolkit/tinyxml2/tinyxml2.o source/dem.o source/heater.o source/loop.o source/main.o source/observer.o -L/opt/local/lib -lboost_program_options-mt
Undefined symbols for architecture x86_64:
  "boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*) in main.o
  "boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)", referenced from:
      _main in main.o
  "boost::program_options::arg[abi:cxx11]", referenced from:
      boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::name() const in main.o
  "boost::program_options::detail::cmdline::cmdline(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)", referenced from:
      boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*) in main.o
  "boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int)", referenced from:
      boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const in main.o
  "boost::program_options::operator<<(std::basic_ostream<char, std::char_traits<char> >&, boost::program_options::options_description const&)", referenced from:
      _main in main.o
  "boost::program_options::abstract_variables_map::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
      _main in main.o
  "boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const", referenced from:
      vtable for boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char> in main.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
scons: *** [bin/ebtel++.run] Error 1
scons: building terminated because of errors.
canty% 

I get other issues when attempting to install on ubuntu, which I will try and track down as well. I have saved the complete output if it helps, but figure that most of it is repeated in form from the first deprecation error noted.

Regardless of how this goes, I owe you a drink/meal at the next meeting. I'll be at SPD and H11 to supply.

Ok this is not the problem I thought it was at all...which is good and bad (???)

So it seems that scons/g++ can find the libraries no problem, but something weird is going any w.r.t. actually linking the libraries.

I wouldn't worry too much about all the warnings if the compile step is successful though I'm not seeing any of these on my machine..

On your Mac, what does

$ g++ --version

give you? For reference, I'm using g++ 4.8.5 on Mac and 4.8.4 on Linux. This SO answer seems to suggest that a problem like this might occur if you've compiled boost with a different compiler than you're using to compile your program

Sorry this is such a pain to compile...I was hoping using a build system like scons would make it easy for others to compile on their machine, but it seems to have had the opposite effect!

No problem here, I haven't dealt with C or C++ in almost a decade, so a lot of it is on me.

canty% g++ --version
g++ (GCC) 5.1.0

Additionally, I am running Xcode Version 8.2.1 (8C1002) (since it is more fun to blame Apple).

I'm always happy to make Apple the scapegoat.

See this SO answer too

Perhaps Macports compiled boost with clang++ instead of g++? So maybe try uninstalling boost again and then reinstall, but forcing it to compile with g++. Even though v5.1 should be fine, I would recommend v4.8 just so we are both working with the same version.

Nice Find! I think that may be the issue, though I cannot yet verify. It appears that macports does not currently offer a gcc/g++ capable variange (at least as far as I can tell:)

Variants:             clang33, clang34, clang35, clang36, clang37, clang38, clang39, debug, mpich,
                      mpich_devel, [+]no_single, [+]no_static, openmpi, openmpi_devel, python26,
                      [+]python27, python33, python34, python35, python36, regex_match_extra, universal

The mpich version does not want to compile for me. I have reinstalled all of macports in hopes that it would fix the issue. I haven't gotten it to compile with any of the commands (or reasonable variants) suggested on SO, which I think is due to a change in available macports ports. Can you run one test on your machine and post the result?

otool -L /opt/local/lib/libboost_program_options-mt.dylib

and let me know if it contains:

usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)

or something containing libstdc++. The SO link suggests that is the best version check on how it was compiled, and could verify that yours is clang (libc++) or gcc (libstdc++). I think I can figure out how to compile it not in clang with brew, but I will delay that attempt in hopes of avoiding other complications at this time.

I couldn't move on until I tried the next option (though I thought I could). I am not currently convinced it is a clang compilation issue (but also not completely convinced otherwise). I recompiled and used the brew version of boost, which I verified utilized gcc4.8 for the compilation as suggested by SO. I got the same results. I am currently out of options, which means I think I can move away from it for now. I don't want to try and add or even look at the potential ubuntu differences tonight.

As for next possibilities: One possibility I thought of, (though, I am bad with processor speak) is that the 2009 MBP is a core 2 duo, while mine is now an i7. They are both intel, so I wouldn't expect that to be too large of an issue (as there are between PPCs and intels, although may an x64 vs x32 issue?). There also appears to be some macports/el capitan issues, which could be part of it on my end (if you are not running el capitan).

I think you may be right re: clang versus g++ issues. Running,

$ otool -L /opt/local/lib/libboost_program_options-mt.dylib

I get,

/opt/local/lib/libboost_program_options-mt.dylib:
	/opt/local/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

which (based on the SO answer) suggests I have also compiled Boost with clang. So maybe it is just best to stick with your original Macports install.

I doubt this is related to differences in processors (though I could be wrong). I'm also running El Capitan so that is also not likely the issue. Out of curiosity, is the version of gcc/g++ you're using the default system one or a version installed with Macports? (if which shows it in /opt/local/bin it is probably Macports)

Just a stab in the dark, but maybe try going the other way and compile ebtel++ with clang. You can do this by just setting the CXX environment variable at the command line and scons will pick it up automatically,

$ export CXX=clang++

@adamrkob were you ever able to solve this problem?

No problem at all. Sorry this has been a bit of a headache. Post back here when you have time and hopefully we can sort out the problem.

OK. It has been a long time since I looked at this. I think, though, that I have made progress, and potentially found a work around. For a refresher, the scons command was failing, giving either a lot of errors, or giving a simple error that

fatal error: malloc.h: No such file or directory
#include <malloc.h>
^

For other reasons, I did a clean install of MacOS 10.13. I then attempt to re-install from scratch, using tools from homebrew.

I got the same results as before, in particular the malloc.h file was not found. I then did a bit of searching around SO, and became partially convinced that malloc.h might be just for older architectures and Linux and not MacOS, and thus might not be needed. So I commented out the line:
#include <malloc.h>

from

Radiation_Model/source/OpticallyThick/OpticallyThickIon.cpp
Radiation_Model/source/element.cpp
rsp_toolkit/source/fitpoly.cpp

Everything compiles with scons now (with no flags), and I was able to run ebtel++ and obtain results. What I don't know is if these results are just BS now. I was able to successfully replicate the example results, but I don't know how robust that is to verifying the results. If you have some test suggestions, please let me know and I can verify if this is a solution. If it is a solution, it seems too easy to have been such a headache before.

@adamrkob Glad things seem to be working now. I would try opening up the file ebtel++_results_file.txt that the model produces and plotting the results (in IDL or Python or whatever, it is just plain text). You should be able to see the resulting T,n curves for three different heating pulses. You can find more info about the results file in the documentation. You can also run an additional set of tests by running

$ scons --test

and it will complete four separate runs and store the results in test/test_{number}_results. (Note that you may have trouble running this if you don't have the Numpy python library installed).

If you have Python installed on your machine, you could take a look at a few of the example scripts in examples as well. The documentation page shows what the results should look like. If you don't have Python, you could configure the inputs by hand relatively easy. Try using the the example configuration in config/ebtel.example.cfg.xml as a guide.

I'm really confused about why the malloc.h has been such an issue. I'm running mac OS 10.12.6 (Sierra) and haven't encountered this issue. Out of curiosity, what does,

$ ls /usr/include/malloc

show in your terminal? This is where scons assumes that malloc is located. From what I can tell, this is only installed once you've installed the XCode developer tools.

I believe you're right about malloc.h not being necessary here. The bit of code that needs it was not written by me and is actually not called unless the full radiative loss function is used and this feature is not yet implemented.

Thanks @wtbarnes ! I shouldn't have buried it in my prior posts, but I did run all the tests, and they were the same as the expected test results, so I think it is all working well.

I was able to get it all to work without the Xcode command line development tools (but with the base Xcode packages). This was a mistake on my part, as I thought I had installed this part when I got homebrew up and running. Without the command line tools, at least in macOS 10.13, there is not /usr/include/ directory, and spotlight did not find (though it may not have fully indexed everything yet since it was a fresh install of macOS) any malloc.h . I just added the command line tools and there is now a malloc.h sitting in /usr/include/malloc/ . Later I will attempt to uncomment the relevant lines and try again (since there appear to be no calls requiring malloc.h definitions, I foresee no problems). Thanks again! Now to porting the rest of my EBTEL IDL scripts into python.

Great to hear @adamrkob. Yes you should be able to uncomment those lines now (not that it matters too much). I've actually done the same thing before re: not installing XCode command line tools. Stuff seems to work at first, but then you get weird and unexpected errors later on.

Let me know if you have any other problems or if you have any feedback on how the code and/or documentation could be better. I'll go ahead and close this issue as it seems your problem has been resolved.

Hi Will,

Sorry to bother again! But I am now working on new machines, and attempting to get it working has put me in the same position as before. A few things have changed for this round, though. Notable is that I am using conda for all installations, and am running python 3.6.

I assume the problem is that I now need to point scans to the relevant directories for where conda puts things.

$ scons --includepath=/usr/local/include,/usr/include/malloc --libpath=/usr/local/lib

(or similar) worked before, but I am trying to determine what the correct paths are for the conda installed version. If you know these off the top of your head, feel free to let me know. Otherwise, I am using this in hopes of providing a record of the solution for the next time it comes up.

Thanks,

Adam

This is something I've been meaning to document for a while. I've created a new issue #41 so let's move the discussion there!