Compiling lastools on OSX Maverick

400 views
Skip to first unread message

Dr. Antoine Cottin

unread,
Apr 8, 2014, 11:05:06 AM4/8/14
to last...@googlegroups.com
Hello,

I'm trying to compile LASTools on Maverick 10.9 and I've some issue.
I've modified some makefile to solve some issue related to <tr1/unordered_map> not found.
I'm now banging another issue and I'm a bit perplex... if anyone has a idea of what is going wrong here, it would be greatly appreciated.

I'm not sure if it's an architecture issue or a dependancy issue...

I've commenting out the "cd example && make" because it was throwing the same type of error... 

Thanks
Cheers.
Antoine

cd LASlib && make
cd src && make
make[2]: Nothing to be done for `all'.
#cd example && make
cd LASzip && make
#cd example && make
cd src && make
g++  -O3 -Wall -Wno-deprecated -DNDEBUG  -v laszip.o geoprojectionconverter.o -llas -o laszip  -L../LASlib/lib  -I../LASzip/src -I../LASlib/inc
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o laszip -L../LASlib/lib laszip.o geoprojectionconverter.o -llas -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
  "std::istream::get()", referenced from:
      ByteStreamInIstream::getByte() in liblas.a(lasreader_las.o)
  "std::istream::read(char*, long)", referenced from:
      ByteStreamInIstream::getBytes(unsigned char*, unsigned int) in liblas.a(lasreader_las.o)
  "std::istream::seekg(std::fpos<__mbstate_t>)", referenced from:
      ByteStreamInIstream::seek(long long) in liblas.a(lasreader_las.o)
  "std::istream::seekg(long long, std::_Ios_Seekdir)", referenced from:
      ByteStreamInIstream::seekEnd(long long) in liblas.a(lasreader_las.o)
  "std::istream::tellg()", referenced from:
      ByteStreamInIstream::tell() const in liblas.a(lasreader_las.o)
  "std::ostream::put(char)", referenced from:
      ByteStreamOutOstream::putByte(unsigned char) in liblas.a(laswriter_las.o)
  "std::ostream::seekp(std::fpos<__mbstate_t>)", referenced from:
      ByteStreamOutOstream::seek(long long) in liblas.a(laswriter_las.o)
  "std::ostream::seekp(long long, std::_Ios_Seekdir)", referenced from:
      ByteStreamOutOstream::seekEnd() in liblas.a(laswriter_las.o)
  "std::ostream::tellp()", referenced from:
      ByteStreamOutOstream::tell() const in liblas.a(laswriter_las.o)
  "std::ostream::write(char const*, long)", referenced from:
      ByteStreamOutOstream::putBytes(unsigned char const*, unsigned int) in liblas.a(laswriter_las.o)
  "std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
      std::_Rb_tree<LASintervalStartCell*, LASintervalStartCell*, std::_Identity<LASintervalStartCell*>, std::less<LASintervalStartCell*>, std::allocator<LASintervalStartCell*> >::_M_insert_unique(LASintervalStartCell* const&) in liblas.a(lasinterval.o)
  "std::_Rb_tree_increment(std::_Rb_tree_node_base const*)", referenced from:
      LASinterval::merge(bool) in liblas.a(lasinterval.o)
  "std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
      LASinterval::merge_intervals(unsigned int) in liblas.a(lasinterval.o)
  "std::__throw_length_error(char const*)", referenced from:
      std::vector<int, std::allocator<int> >::_M_insert_aux(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, int const&) in liblas.a(lasquadtree.o)
  "std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
      LASinterval::merge(bool) in liblas.a(lasinterval.o)
      LASinterval::merge_intervals(unsigned int) in liblas.a(lasinterval.o)
  "std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
      LASinterval::merge(bool) in liblas.a(lasinterval.o)
      LASinterval::merge_intervals(unsigned int) in liblas.a(lasinterval.o)
      std::_Rb_tree<LASintervalStartCell*, LASintervalStartCell*, std::_Identity<LASintervalStartCell*>, std::less<LASintervalStartCell*>, std::allocator<LASintervalStartCell*> >::_M_insert_unique(LASintervalStartCell* const&) in liblas.a(lasinterval.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [laszip] Error 1
make: *** [all] Error 2




Ravi Peters

unread,
Apr 9, 2014, 9:01:01 AM4/9/14
to last...@googlegroups.com
Hi there,
I managed to compile the lastools on Mavericks with some minor modifications:

For the files LASlib/src/lasinterval.cpp and LASlib/src/lasindex.cpp, find and replace these lines:

1: #include <tr1/unordered_map> TO #include <unordered_map>
2: using namespace tr1; TO //using namespace tr1; 

that's all.

Cheers,
Ravi


Op dinsdag 8 april 2014 17:05:06 UTC+2 schreef Dr. Antoine Cottin:

Dr. Antoine Cottin

unread,
Apr 9, 2014, 10:55:57 AM4/9/14
to last...@googlegroups.com
Thanks Ravi,

I’ve solved this issue also by adding the following to the makefile (LASlib/scr)
-I/usr/include/c++/4.2.1/ at the INCLUDE flag line
Whith this no need to modify and comment out tr1

The error seems somewhere else for me.
Cheers
Antoine
-------------------
Dr Antoine Cottin
Senior Software Developer/Analyst
Carbomap Ltd
7th Floor, Appleton Tower
11 Crichton Street
Edinburgh
EH8 9LE
http://www.carbomap.com

Ravi Peters

unread,
Apr 9, 2014, 4:40:15 PM4/9/14
to last...@googlegroups.com, a.co...@carbomap.com
Hi Antoine,

I did a quick check with your modification only. Result: I get the same error message you posted. It seems that you are actually causing this error by your modification. 

I suggest you still try the modifications that I proposed (and restore the makefiles to their original state). It works for me.

Cheers,
Ravi

Op woensdag 9 april 2014 16:55:57 UTC+2 schreef Dr. Antoine Cottin:

Dr. Antoine Cottin

unread,
Apr 10, 2014, 4:32:00 AM4/10/14
to last...@googlegroups.com
Ravi,

Thanks it worked.

Cheers
Antoine

-------------------
Dr Antoine Cottin
Senior Software Developer/Analyst
Carbomap Ltd
7th Floor, Appleton Tower
11 Crichton Street
Edinburgh
EH8 9LE
http://www.carbomap.com

gvsi...@gmail.com

unread,
Jul 2, 2014, 10:49:23 AM7/2/14
to last...@googlegroups.com, a.co...@carbomap.com
Compilation works doing the changes proposed by Ravi, thanks. But as he said elsewhere we only got las2las, las2txt, lasdiff, lasindex, lasinfo, lasmerge, laszip, lasprecision, txt2las

El dijous 10 d’abril de 2014 10:32:00 UTC+2, Dr. Antoine Cottin va escriure:

Antoine Cottin

unread,
Jul 2, 2014, 11:14:42 AM7/2/14
to last...@googlegroups.com
It is because you’re on a mac/linux…
Other modules are only for window
Antoine
-----------------------
Dr Antoine Cottin
Chief Technology Officer
Carbomap Ltd.

7th Floor, Appleton Tower
11 Crichton Street
Edinburgh
EH8 9LE

Dan Clewley

unread,
Mar 1, 2015, 7:45:25 AM3/1/15
to last...@googlegroups.com
Hi,

I submitted a pull request with these changes needed to compile on OS X using a preprocessor check for OS X and clang which Martin has merged (thanks Martin).

The open source LAStools and LASlib should now compile under OS X with no modifications if you get the source from GitHub.

Thanks,

Dan
Reply all
Reply to author
Forward
0 new messages