Opened 7 years ago

Closed 6 years ago

#56177 closed defect (fixed)

octave-control: adds non-existing folders to -L and fails to build

Reported by: mojca (Mojca Miklavec) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: seanfarley (Sean Farley), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: octave-devel octave-control

Description

The octave-control package seems to be broken:

:info:configure /opt/local/bin/gfortran-mp-7 -c -fPIC -pipe -Os -m64     select.f -o select.o
:info:configure ar -rc slicotlibrary.a ./sltmp/*.o
:info:configure rm -rf sltmp slicot
:info:configure LFLAGS="-L/opt/local/lib/octave/4.3.0+ -L/opt/local/lib  -L/opt/local/lib -lvecLibFort  -L/opt/local/lib -L/opt/local/libexec/qt5/lib -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0 -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0/../../.. -lgfortran -lquadmath -lm" \
:info:configure     /usr/bin/arch -arch x86_64 /opt/local/bin/mkoctfile-4.3.0+ --verbose __control_slicot_functions__.cc common.cc slicotlibrary.a
:info:configure /usr/bin/clang++ -c -I/opt/local/include -fPIC -I/opt/local/include/octave-4.3.0+/octave/.. -I/opt/local/include/octave-4.3.0+/octave -I/opt/local/include  -D_THREAD_SAFE -pthread -pipe -Os -std=c++11 -stdlib=libc++ -arch x86_64    __control_slicot_functions__.cc -o __control_slicot_functions__.o
:info:configure /usr/bin/clang++ -c -I/opt/local/include -fPIC -I/opt/local/include/octave-4.3.0+/octave/.. -I/opt/local/include/octave-4.3.0+/octave -I/opt/local/include  -D_THREAD_SAFE -pthread -pipe -Os -std=c++11 -stdlib=libc++ -arch x86_64    common.cc -o common.o
:info:configure /usr/bin/clang++ -std=gnu++11 -I/opt/local/include/octave-4.3.0+/octave/.. -I/opt/local/include/octave-4.3.0+/octave -I/opt/local/include  -D_THREAD_SAFE -pthread -pipe -Os -std=c++11 -stdlib=libc++ -arch x86_64 -bundle -bundle_loader /opt/local/bin/octave-4.3.0+  -o __control_slicot_functions__.oct  __control_slicot_functions__.o common.o  slicotlibrary.a  -L/opt/local/lib/octave/4.3.0+ -L/opt/local/lib  -L/opt/local/lib -lvecLibFort  -L/opt/local/lib -L/opt/local/libexec/qt5/lib -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0 -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0/../../.. -lgfortran -lquadmath -lm -loctinterp -loctave  
:info:configure clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
:info:configure ld: warning: directory not found for option '-L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0'
:info:configure ld: warning: directory not found for option '-L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0/../../..'
:info:configure ld: library not found for -lgfortran
:info:configure clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:configure make: *** [__control_slicot_functions__.oct] Error 1
:info:configure pkg: error running `make' for the control package.

Change History (9)

comment:1 Changed 7 years ago by Schamschula (Marius Schamschula)

This sure seems like an issue introduced by

https://github.com/macports/macports-ports/commit/907a4a8117d60463b70f5c3da327f4b7e8d34946

or more precisely

https://github.com/macports/macports-ports/commit/e4b7cef1fd26bb17abd0434670fa16884cd21513

There were not such issues before that change to the compilers PortGroup.

comment:2 Changed 7 years ago by mojca (Mojca Miklavec)

Cc: seanfarley added

comment:3 Changed 7 years ago by mojca (Mojca Miklavec)

Cc: MarcusCalhoun-Lopez added
Port: octave-devel added

The problem seems to be here:

/opt/local/bin/mkoctfile -p FLIBS
 -L/opt/local/lib -L/opt/local/libexec/qt5/lib -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0 -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0/../../.. -lgfortran -lquadmath -lm

This is from control/src/Makefile:

ifndef LAPACK_LIBS
LAPACK_LIBS := $(shell $(MKOCTFILE) -p LAPACK_LIBS)
endif
ifndef BLAS_LIBS
BLAS_LIBS := $(shell $(MKOCTFILE) -p BLAS_LIBS)
endif
ifndef FLIBS
FLIBS := $(shell $(MKOCTFILE) -p FLIBS)
endif
LFLAGS := $(shell $(MKOCTFILE) -p LFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

So I would blame octave[-devel] for now (I have octave-devel installed).

comment:4 Changed 7 years ago by mojca (Mojca Miklavec)

We have:

> port provides /opt/local/lib/gcc7/libgfortran.4.dylib
/opt/local/lib/gcc7/libgfortran.4.dylib is provided by: gcc7
> port provides /opt/local/lib/libgcc/libgfortran.4.dylib
/opt/local/lib/libgcc/libgfortran.4.dylib is provided by: libgcc

I would be grateful to know the difference.

As far as /opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.2.0 is concerned: why do we even have such a strange path? I figured out that there's indeed /opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/ present on my machine (but that's 7.3.0 rather than 7.2.0). What's that doing there? Those files belong to gcc7.

Last edited 7 years ago by mojca (Mojca Miklavec) (previous) (diff)

comment:5 Changed 7 years ago by Schamschula (Marius Schamschula)

I think the error use elsewhere. With regular octave, which is now ahead of octave-devel, I get

/opt/local/bin/mkoctfile -p FLIBS
-L/opt/local/lib -L/opt/local/libexec/qt5/lib -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0 -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/../../.. -lgfortran -lquadmath -lm

I just checked, octave-control rebuilt against octave w/o any errors.

comment:6 Changed 7 years ago by Schamschula (Marius Schamschula)

On further review: it looks like octave-devel needs a rev bump to rebuild against gcc7 7.3.0.

comment:7 Changed 7 years ago by mojca (Mojca Miklavec)

Octave apparently uses some of the output from:

>  echo "      END" > foo.f && gfortran-mp-7 -v foo.f
Driving: gfortran-mp-7 -v foo.f -mmacosx-version-min=10.13.4 -asm_macosx_version_min=10.13 -l gfortran -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran-mp-7
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin17/7.3.0/lto-wrapper
Target: x86_64-apple-darwin17
Configured with: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc7/gcc7/work/gcc-7.3.0/configure --prefix=/opt/local --build=x86_64-apple-darwin17 --enable-languages=c,c++,objc,obj-c++,lto,fortran --libdir=/opt/local/lib/gcc7 --includedir=/opt/local/include/gcc7 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-7 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-7 --with-gxx-include-dir=/opt/local/include/gcc7/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-tls --with-pkgversion='MacPorts gcc7 7.3.0_0'
Thread model: posix
gcc version 7.3.0 (MacPorts gcc7 7.3.0_0) 
COLLECT_GCC_OPTIONS='-v' '-mmacosx-version-min=10.13.4' '-asm_macosx_version_min=10.13' '-shared-libgcc' '-mtune=core2'
 /opt/local/libexec/gcc/x86_64-apple-darwin17/7.3.0/f951 foo.f -ffixed-form -fPIC -quiet -dumpbase foo.f -mmacosx-version-min=10.13.4 -mtune=core2 -auxbase foo -version -fintrinsic-modules-path /opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/finclude -o /var/folders/v9/whwh1pfx63dbtd1spmzf317r0000gn/T//cc4jNxOh.s
GNU Fortran (MacPorts gcc7 7.3.0_0) version 7.3.0 (x86_64-apple-darwin17)
	compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version isl-0.18-GMP

warning: MPC header version 1.0.3 differs from library version 1.1.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran2008 (MacPorts gcc7 7.3.0_0) version 7.3.0 (x86_64-apple-darwin17)
	compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version isl-0.18-GMP

warning: MPC header version 1.0.3 differs from library version 1.1.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-v' '-mmacosx-version-min=10.13.4'  '-shared-libgcc' '-mtune=core2'
 /opt/local/bin/as -v -arch x86_64 -force_cpusubtype_ALL -o /var/folders/v9/whwh1pfx63dbtd1spmzf317r0000gn/T//ccv1ONOB.o /var/folders/v9/whwh1pfx63dbtd1spmzf317r0000gn/T//cc4jNxOh.s
Apple Inc version cctools-895, GNU assembler version 1.38
Reading specs from /opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/../../../libgfortran.spec
rename spec lib to liborig
COLLECT_GCC_OPTIONS='-v' '-mmacosx-version-min=10.13.4'  '-shared-libgcc' '-mtune=core2'
COMPILER_PATH=/opt/local/libexec/gcc/x86_64-apple-darwin17/7.3.0/:/opt/local/libexec/gcc/x86_64-apple-darwin17/7.3.0/:/opt/local/libexec/gcc/x86_64-apple-darwin17/:/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/:/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/
LIBRARY_PATH=/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/:/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/../../../
COLLECT_GCC_OPTIONS='-v' '-mmacosx-version-min=10.13.4'  '-shared-libgcc' '-mtune=core2'
 /opt/local/libexec/gcc/x86_64-apple-darwin17/7.3.0/collect2 -dynamic -arch x86_64 -macosx_version_min 10.13.4 -weak_reference_mismatches non-weak -o a.out -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0 -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/../../.. /var/folders/v9/whwh1pfx63dbtd1spmzf317r0000gn/T//ccv1ONOB.o -lgfortran -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm -lgcc_ext.10.5 -lgcc -lSystem -v
collect2 version 7.3.0
/opt/local/bin/ld -dynamic -arch x86_64 -macosx_version_min 10.13.4 -weak_reference_mismatches non-weak -o a.out -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0 -L/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/../../.. /var/folders/v9/whwh1pfx63dbtd1spmzf317r0000gn/T//ccv1ONOB.o -lgfortran -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm -lgcc_ext.10.5 -lgcc -lSystem -v
@(#)PROGRAM:ld  PROJECT:ld64-274.2
configured to support archs: i386 x86_64 x86_64h armv6 armv7 armv7s armv7m armv7k arm64 (tvOS)
Library search paths:
	/opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0
	/opt/local/lib/gcc7
	/usr/lib
Framework search paths:
	/Library/Frameworks/
	/System/Library/Frameworks/
 /opt/local/bin/nm -n /var/folders/v9/whwh1pfx63dbtd1spmzf317r0000gn/T//ccv1ONOB.o

Still ... the path /opt/local/lib/gcc7/gcc/x86_64-apple-darwin17/7.3.0/../../../ should be correct.

comment:8 Changed 7 years ago by mojca (Mojca Miklavec)

Apart for simply revbumping octave-devel, I suggest to also try to figure out if there's a way to avoid this problem in the future. Maybe gcc could be fixed a bit.

comment:9 Changed 6 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: newclosed

I believe this issue has been fixed.
In particular, octave no longer asks GCC for the library path names.

Note: See TracTickets for help on using tickets.