NanoComp / libctl

Guile-based library implementing flexible control files for scientific simulations
GNU General Public License v2.0
18 stars 22 forks source link

build failure for paths with spaces #15

Open ghost opened 6 years ago

ghost commented 6 years ago

I'm not sure if this is the right place to be posting this, so apologies in advance if it is not. Anyways, I am attempting to install Meep version 1.4.3 on a Windows 7 machine through Cygwin. Harminv and h5utils seem to have installed fine, but I run into an error when attempting to make libctl. Here is the output from the configure script:

$ ./configure checking whether to enable maintainer-specific portions of Makefiles... no checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes configure: WARNING: Libtool does not cope well with whitespace in pwd checking build system type... x86_64-unknown-cygwin checking host system type... x86_64-unknown-cygwin checking how to print strings... printf checking whether make supports the include directive... yes (GNU style) checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe 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 dependency style of gcc... gcc3 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... /usr/x86_64-pc-cygwin/bin/ld.exe checking if the linker (/usr/x86_64-pc-cygwin/bin/ld.exe) is GNU ld... yes 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 whether ln -s works... yes checking the maximum length of command line arguments... 8192 checking how to convert x86_64-unknown-cygwin file names to x86_64-unknown-cygwin format... func_convert_file_noop checking how to convert x86_64-unknown-cygwin file names to toolchain format... func_convert_file_noop checking for /usr/x86_64-pc-cygwin/bin/ld.exe option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL checking for dlltool... dlltool checking how to associate runtime and link libraries... func_cygming_dll_for_implib checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /usr/bin/dd checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 checking for mt... no checking if : is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes 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... no checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... Win32 ld.exe 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... no checking whether to build static libraries... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for indent... indent checking for ANSI C header files... (cached) yes checking for guile... guile checking for sqrt in -lm... yes checking for guile-config... guile-config checking if linking to guile works... yes checking libguile.h usability... yes checking libguile.h presence... yes checking for libguile.h... yes checking guile/gh.h usability... no checking guile/gh.h presence... no checking for guile/gh.h... no ######################### yes ############################## checking for modern non-gh interface... yes checking for gh_enter... no checking for gh_eval_str... no checking for gh_load... no checking for gh_bool2scm... no checking for gh_vector_ref... no checking for gh_list_ref... no checking for gh_length... no checking for scm_flush_all_ports... yes checking for scm_make_complex... yes checking for scm_c_make_rectangular... yes checking for scm_variable_set_x... yes checking for scm_c_lookup... yes checking for scm_c_make_vector... yes checking for scm_variable_ref... yes checking for SCM_COMPLEXP... yes checking whether gh_lookup works properly... no checking for g77... no checking for xlf... no checking for f77... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for xlf90... no checking for f90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... gfortran checking whether we are using the GNU Fortran 77 compiler... yes checking whether gfortran accepts -g... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking for gfortran option to produce PIC... -DDLL_EXPORT checking if gfortran PIC flag -DDLL_EXPORT works... yes checking if gfortran static flag -static works... no checking if gfortran supports -c -o file.o... yes checking if gfortran supports -c -o file.o... (cached) yes checking whether the gfortran linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate checking how to get verbose linking output from gfortran... -v checking for Fortran 77 libraries of gfortran... -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0 -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/lib/../lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../.. -lm -lgfortran -lquadmath -lcygwin -ladvapi32 -lshell32 -luser32 checking for dummy main to link with Fortran 77 libraries... none checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore checking complex.h usability... yes checking complex.h presence... yes checking for complex.h... yes checking for C complex keyword... complex checking for egrep... (cached) /usr/bin/grep -E checking nlopt.h usability... no checking nlopt.h presence... no checking for nlopt.h... no checking for basename in -lgen... no checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating utils/Makefile config.status: creating examples/Makefile config.status: creating examples/example.scm config.status: creating utils/gen-ctl-io config.status: creating config.h config.status: config.h is unchanged config.status: creating src/ctl.h config.status: src/ctl.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands

And here is what comes up when I run make: $ make make all-recursive make[1]: Entering directory '/cygdrive/c/Users/Xiao Research1/Downloads/libctl-4.0.1/libctl-4.0.1' Making all in src make[2]: Entering directory '/cygdrive/c/Users/Xiao Research1/Downloads/libctl-4.0.1/libctl-4.0.1/src' make all-am make[3]: Entering directory '/cygdrive/c/Users/Xiao Research1/Downloads/libctl-4.0.1/libctl-4.0.1/src' make[3]: Leaving directory '/cygdrive/c/Users/Xiao Research1/Downloads/libctl-4.0.1/libctl-4.0.1/src' make[2]: Leaving directory '/cygdrive/c/Users/Xiao Research1/Downloads/libctl-4.0.1/libctl-4.0.1/src' Making all in utils make[2]: Entering directory '/cygdrive/c/Users/Xiao Research1/Downloads/libctl-4.0.1/libctl-4.0.1/utils' make[2]: No rule to make target '/cygdrive/c/Users/Xiao', needed by 'ctl-io.c'. Stop. make[2]: Leaving directory '/cygdrive/c/Users/Xiao Research1/Downloads/libctl-4.0.1/libctl-4.0.1/utils' make[1]: [Makefile:470: all-recursive] Error 1 make[1]: Leaving directory '/cygdrive/c/Users/Xiao Research1/Downloads/libctl-4.0.1/libctl-4.0.1' make: *** [Makefile:378: all] Error 2

I haven't been able to find a similar issue online thus far, so I'm not quite sure what's wrong. It appears as though it is truncating the directory 'Xiao Research1' at the whitespace and is attempting to find path/to/directory/Xiao, which is not a directory. Any idea what's wrong here?

ChristopherHogan commented 6 years ago

The easiest thing to try would be to use a build directory that doesn't have any spaces in the path.

stevengj commented 6 years ago

Yes, paths with spaces will break a lot of Unixy scripts and Makefiles unless they are written very defensively. Even if we fix this for libctl, it is likely that compiling other things will break too.

ghost commented 6 years ago

Thank you, that seems to have resolved that issue. I ran make once, and make check only had near2far fail. I downloaded the gsl-devel package, which was missing before, and make check then had all 19 fail. After running make again, I got this:

$ make make all-recursive make[1]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3' Making all in src make[2]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/src' make all-am make[3]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/src' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/src' make[2]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/src' Making all in tests make[2]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests' Making all in examples make[2]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/examples' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/examples' Making all in libctl make[2]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/libctl' make all-am make[3]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/libctl' CXX meep.o CXX structure.o CXX meep_wrap.o meep_wrap.c Warning: This system cannot link to static lib archive /usr/local/lib/libharminv.la. I have the capability to make that library automatically link in when you link to this library. But I can only do this if you have a shared version of the library, which you do not appear to have. libtool: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries; building static only make[2]: [Makefile:705: libmeepgeom.la] Interrupt make[1]: [Makefile:506: all-recursive] Interrupt make: *** [Makefile:415: all] Interrupt

ChristopherHogan commented 6 years ago

Looks like you need to add the --enable-shared flag when running configure for harminv.

ghost commented 6 years ago

I re-configured harminv with your suggestion, as well as re-ran make and make install. When I run make for meep, it finishes, but with the same warning about libtool. Make check gives the following:

$ make check
Making check in src
make[1]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/src'
make  check-am
make[2]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/src'
make[2]: Nothing to be done for 'check-am'.
make[2]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/src'
make[1]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/src'
Making check in tests
make[1]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests'
make  aniso_disp.exe bench.exe bragg_transmission.exe convergence_cyl_waveguide.exe cylindrical.exe flux.exe harmonics.exe integrate.exe known_results.exe near2far.exe one_dimensional.exe physical.exe stress_tensor.exe symmetry.exe three_d.exe two_dimensional.exe 2D_convergence.exe h5test.exe pml.exe
make[2]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests'
make[2]: 'aniso_disp.exe' is up to date.
make[2]: 'bench.exe' is up to date.
make[2]: 'bragg_transmission.exe' is up to date.
make[2]: 'convergence_cyl_waveguide.exe' is up to date.
make[2]: 'cylindrical.exe' is up to date.
make[2]: 'flux.exe' is up to date.
make[2]: 'harmonics.exe' is up to date.
make[2]: 'integrate.exe' is up to date.
make[2]: 'known_results.exe' is up to date.
make[2]: 'near2far.exe' is up to date.
make[2]: 'one_dimensional.exe' is up to date.
make[2]: 'physical.exe' is up to date.
make[2]: 'stress_tensor.exe' is up to date.
make[2]: 'symmetry.exe' is up to date.
make[2]: 'three_d.exe' is up to date.
make[2]: 'two_dimensional.exe' is up to date.
make[2]: '2D_convergence.exe' is up to date.
make[2]: 'h5test.exe' is up to date.
make[2]: 'pml.exe' is up to date.
make[2]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests'
make  check-TESTS
make[2]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests'
make[3]: Entering directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests'
FAIL: aniso_disp.exe
FAIL: bench.exe
FAIL: bragg_transmission.exe
FAIL: convergence_cyl_waveguide.exe
FAIL: cylindrical.exe
FAIL: flux.exe
FAIL: harmonics.exe
FAIL: integrate.exe
FAIL: known_results.exe
FAIL: near2far.exe
FAIL: one_dimensional.exe
FAIL: physical.exe
FAIL: stress_tensor.exe
FAIL: symmetry.exe
FAIL: three_d.exe
FAIL: two_dimensional.exe
FAIL: 2D_convergence.exe
FAIL: h5test.exe
FAIL: pml.exe
============================================================================
Testsuite summary for meep 1.4.3
============================================================================
# TOTAL: 19
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  19
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to meep@ab-initio.mit.edu
============================================================================
make[3]: *** [Makefile:922: test-suite.log] Error 1
make[3]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests'
make[2]: *** [Makefile:1030: check-TESTS] Error 2
make[2]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests'
make[1]: *** [Makefile:1227: check-am] Error 2
make[1]: Leaving directory '/cygdrive/c/meep-1.4.3/meep-1.4.3/tests'
make: *** [Makefile:506: check-recursive] Error 1
ChristopherHogan commented 6 years ago

What errors do you see in tests/test-suite.log?

ghost commented 6 years ago

They all appear to have the same error, of this form: C:/meep-1.4.3/meep-1.4.3/tests/.libs/h5test.exe: error while loading shared libraries: cygstdc++-6.dll: cannot open shared object file: No such file or directory FAIL h5test.exe (exit status: 127)

But for each file being tested.

Edit: This seems to be some kind of missing library/incorrect path issue. Apparently in Cygwin usr/bin is just a link to /bin, perhaps the Makefile is searching a PATH which includes usr/bin? That's my guess right now.

ghost commented 6 years ago

It works now. I forgot to run ranlib again after configuring harminv with shared enable. Thanks for the help.