flow-project / flow

Computational framework for reinforcement learning in traffic control
MIT License
1.06k stars 375 forks source link

proj-includes not found when building sumo from source on macOS #546

Closed bmwilly closed 4 years ago

bmwilly commented 5 years ago

Choose an option This is a:

Describe the issue Following the instructions to build sumo from source on macOS leads to the following error:

$ ./configure CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=gnu++11" --with-xerces=/usr/local --with-proj-gdal=/usr/local
.
.
.
configure: error: proj-includes not found in "/usr/local/include".

To Reproduce

(flow) ➜  sumo git:(master) ✗ g co 2147d155b1
Checking out files: 100% (19725/19725), done.
M   tests/complex/tutorial/quickstart/data/quickstart.net.xml
Note: checking out '2147d155b1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 2147d155b1 version info for cmake, refs #563
(flow) ➜  sumo git:(2147d155b1) ✗ make -f Makefile.cvs
autoreconf -i
glibtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
glibtoolize: and rerunning glibtoolize and aclocal.
glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
glibtoolize: 'AC_PROG_RANLIB' is rendered obsolete by 'LT_INIT'
(flow) ➜  sumo git:(2147d155b1) ✗ brew update
brew install Caskroom/cask/xquartz
brew install autoconf
brew install automake
brew install pkg-config
brew install libtool
brew install gdal
brew install proj
brew install xerces-c
brew install fox
export CPPFLAGS=-I/opt/X11/include
export LDFLAGS=-L/opt/X11/lib
Updated 4 taps (homebrew/cask-versions, homebrew/core, homebrew/cask and caskroom/cask).
==> Updated Formulae
angular-cli                      cocoapods                        lxc                              presto
==> brew cask install Caskroom/cask/xquartz
Warning: Cask 'xquartz' is already installed.

To re-install xquartz, run:
  brew cask reinstall xquartz
Warning: autoconf 2.69 is already installed and up-to-date
To reinstall 2.69, run `brew reinstall autoconf`
Warning: automake 1.16.1_1 is already installed and up-to-date
To reinstall 1.16.1_1, run `brew reinstall automake`
Warning: pkg-config 0.29.2 is already installed and up-to-date
To reinstall 0.29.2, run `brew reinstall pkg-config`
Warning: libtool 2.4.6_1 is already installed and up-to-date
To reinstall 2.4.6_1, run `brew reinstall libtool`
Warning: gdal 2.4.1_1 is already installed and up-to-date
To reinstall 2.4.1_1, run `brew reinstall gdal`
Warning: proj 6.1.0 is already installed and up-to-date
To reinstall 6.1.0, run `brew reinstall proj`
Warning: xerces-c 3.2.2 is already installed and up-to-date
To reinstall 3.2.2, run `brew reinstall xerces-c`
Warning: fox 1.6.56_1 is already installed and up-to-date
To reinstall 1.6.56_1, run `brew reinstall fox`
(flow) ➜  sumo git:(2147d155b1) ✗ ./configure CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=gnu++11" --with-xerces=/usr/local --with-proj-gdal=/usr/local
checking build system type... x86_64-apple-darwin18.6.0
checking host system type... x86_64-apple-darwin18.6.0
checking target system type... x86_64-apple-darwin18.6.0
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '502' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
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 whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking dependency style of clang++... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
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 the maximum length of command line arguments... 196608
checking how to convert x86_64-apple-darwin18.6.0 file names to x86_64-apple-darwin18.6.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin18.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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... no
checking for strip... strip
checking for ranlib... (cached) ranlib
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... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for ANSI C header files... no
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... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin18.6.0 dyld
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 how to run the C++ preprocessor... clang++ -E
checking for ld used by clang++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the clang++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for clang++ option to produce PIC... -fno-common -DPIC
checking if clang++ PIC flag -fno-common -DPIC works... yes
checking if clang++ static flag -static works... no
checking if clang++ supports -c -o file.o... yes
checking if clang++ supports -c -o file.o... (cached) yes
checking whether the clang++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin18.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for xerces-c >= 3.0... yes
checking for main in -lxerces-c... yes
checking xercesc/util/XercesVersion.hpp usability... yes
checking xercesc/util/XercesVersion.hpp presence... yes
checking for xercesc/util/XercesVersion.hpp... yes
checking for main in -lproj... yes
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: proj-includes not found in "/usr/local/include".

Note that proj is definitely installed:

(flow) ➜  sumo git:(2147d155b1) ✗ ll /usr/local/include | ag proj
lrwxr-xr-x    1 brandon  staff    48B May  5 20:33 epsg_proj.inc -> ../Cellar/libgeotiff/1.5.1/include/epsg_proj.inc
lrwxr-xr-x    1 brandon  staff    39B May 20 09:58 geodesic.h -> ../Cellar/proj/6.1.0/include/geodesic.h
lrwxr-xr-x    1 brandon  staff    43B May 20 09:58 org_proj4_PJ.h -> ../Cellar/proj/6.1.0/include/org_proj4_PJ.h
lrwxr-xr-x    1 brandon  staff    33B May 20 09:58 proj -> ../Cellar/proj/6.1.0/include/proj
lrwxr-xr-x    1 brandon  staff    35B May 20 09:58 proj.h -> ../Cellar/proj/6.1.0/include/proj.h
lrwxr-xr-x    1 brandon  staff    39B May 20 09:58 proj_api.h -> ../Cellar/proj/6.1.0/include/proj_api.h
lrwxr-xr-x    1 brandon  staff    45B May 20 09:58 proj_constants.h -> ../Cellar/proj/6.1.0/include/proj_constants.h
lrwxr-xr-x    1 brandon  staff    48B May 20 09:58 proj_experimental.h -> ../Cellar/proj/6.1.0/include/proj_experimental.h
lrwxr-xr-x    1 brandon  staff    49B May 20 09:58 proj_symbol_rename.h -> ../Cellar/proj/6.1.0/include/proj_symbol_rename.h
(flow) ➜  sumo git:(2147d155b1) ✗ brew info proj
proj: stable 6.1.0 (bottled), HEAD
Cartographic Projections Library
https://proj4.org/
Conflicts with:
  blast (because both install a `libproj.a` library)
/usr/local/Cellar/proj/6.1.0 (58 files, 11.9MB) *
  Poured from bottle on 2019-05-20 at 09:58:16
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/proj.rb
==> Dependencies
Build: pkg-config ✔
==> Options
--HEAD
    Install HEAD version
==> Analytics
install: 12,180 (30 days), 32,910 (90 days), 95,434 (365 days)
install_on_request: 1,650 (30 days), 4,373 (90 days), 11,226 (365 days)
build_error: 0 (30 days)

Expected behavior sumo to build successfully

Screenshots

Desktop (please complete the following information):

Additional context

AboudyKreidieh commented 5 years ago

hi @bmwilly from these lines:

checking for main in -lproj... yes
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no

it looks like the problem might be proj_api.h. Can you check if this in in /usr/local/include? Maybe if you link this file to this folder the problem could be resolved.

bmwilly commented 5 years ago

@AboudyKreidieh you can see that it exists in my previous comment image

xiaoToby commented 5 years ago

hi @bmwilly from these lines:

checking for main in -lproj... yes
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no

it looks like the problem might be proj_api.h. Can you check if this in in /usr/local/include? Maybe if you link this file to this folder the problem could be resolved.

How to link that file to this folder? I really face many problems when install procedure. Please help.

shanto268 commented 4 years ago

Hi,

I faced the same issue and this is how I fixed it. Instead of the recommended command: $ ./configure CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=gnu++11" --with-xerces=/usr/local --with-proj-gdal=/usr/local Just use: $ ./configure and then follow along with the instructions and if that doesn't help use this: $ brew tap dlr-ts/sumo $ brew install sumo Make sure your environment variables are pointing to the right directories though. Refer to: https://sumo.dlr.de/docs/Installing/MacOS_Build.html

bmwilly commented 4 years ago

closing since I no longer use flow