Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28381 Discussions

Warning unknown option --start-group

Jakob_E_
Beginner
2,025 Views

I have this makefile that works on a ubuntu dist with an older compiler 2011..., but i need it to work on mac yosemite now with a new compiler. But i get this warning message when i want to compile my makefile

ipo: warning #11016: Warning unknown option --start-group

ipo: warning #11016: Warning unknown option --end-group

ld: unknown option: --start-group

make: *** [run_tl_J2iso_Jakob.x] Error 1

here is my makefile code

LLIBS =  -L/Applications/MATLAB_R2015b.app/bin/maci64 -leng -lmat -lmx -lut  -Wl,--start-group ${MKLROOT}/libmkl_intel_lp64.a ${MKLROOT}/libmkl_core.a ${MKLROOT}/libmkl_intel_thread.a -Wl,--end-group -lpthread -lm   

Does anyone know whats wrong?

0 Kudos
8 Replies
Kevin_D_Intel
Employee
2,025 Views

The --start-group/--end-group are not supported by ld for OS X. You can try removing them to see whether your app links; however, if their functionality is needed then you may need to repeat the MKL libs on the command-line to satisfy all the external references.

Maybe another alternative is removing the entire –Wl,–-start-group/-Wl,--end-group string and simply using the compiler driver's -mkl option to allow the compiler driver to provide the MKL libraries for the link. This option default to dynamic MKL versions so if static MKL versions are really needed then you may also try adding: -static-intel   although this option will pick-up static MKL and static compiler RTLs.

0 Kudos
mecej4
Honored Contributor III
2,025 Views

He seems to be linking with Matlab as well as MKL. The --start-group and --end-group are applied to the MKL libraries and, in addition, IPO has been requested and static MKL libraries specified. I do not know if the OSX version of ld is capable of handling this complex combination with the same command syntax as the Linux version.

0 Kudos
Kevin_D_Intel
Employee
2,026 Views

Yes it is complex but it really boils down to ld for OS X not supporting --start-group/--end-group.

The messages are tagged with IPO because as you note, he's throwing -ipo and feeding all this through the compiler driver. The driver is working fine and detects/reports the ld messages tagged with ipo warnings. But it is just ld that does not support --start-group/--end-group so if that functionality is needed then it will have to be re-created in some other manner for OS X.

$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-264.3.102
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: LLVM version 7.3.0

$ ld test.o --start-group mytestlib.a -Wl,--end-group
ld: unknown option: --start-group

When fed through the driver w/-ipo, the ipo warnings and ld error are issued.

$ ifort -ipo test.o -Wl,--start-group mylib.a -Wl,--end-group
ipo: warning #11016: Warning unknown option --start-group
ipo: warning #11016: Warning unknown option --end-group
ld: unknown option: --start-group

 

 

 

0 Kudos
Jakob_E_
Beginner
2,025 Views

Hi thanks for the help, much appreciated!

If i remove the --start-group.... it gives the following messages which im not certain has to do with this at all, here is one.

Undefined symbols for architecture x86_64:

  "_mxcopyinteger4toptr_", referenced from:

      _matlab_util_mp_f2mat_int2_ in matlab_util.o

      _matlab_util_mp_f2mat_int_v2_ in matlab_util.o

Not sure about the "repeat the MKL libs on the command-line", how would that look?

I was thinking about installing a  linux distro anyway, maybe it will be easier to just install a linux compiler? 

Sorry for my poor level of knowledge regarding this.

0 Kudos
Kevin_D_Intel
Employee
2,025 Views

No need to apologize.

Your new link error relates to references in your Fortran MATLAB code to the symbol indicated but the symbol was not found in what was provided to the linker. I don’t know what the origin of the symbol noted is; whether it comes from MATLAB source you compiled or another lib. You could perhaps scan the source you compiled to see if its defined. Maybe the corresponding source file was not compiled, or an object was missed somehow.

Repeating the MKL libs means duplicating libs appearing between the --start-group and --end-group on the link command line (it would be within your LLIB variable). The purpose/function of the start/end-group options is to inform the linker to repeatedly search the indicated libs until no new undefined references are created. In looking at the driver output when using the –mkl option, for OS X, the driver creates this sub-set of linker options:

    -lmkl_intel_lp64 \
    -lmkl_intel_thread \
    -lmkl_core \
    -liomp5 \
    -lmkl_intel_lp64 \
    -lmkl_intel_thread \
    -lmkl_core

You can see the compiler driver’s duplication of the MKL libs. In your case, I don’t know whether simply including MKL libs (in your LLIB variable sans the start/end-group markers) twice with no other libs between them would suffice or not. You could try that for starters, but doing that won’t help with the new undefined symbol error.

I can’t really advise on whether Linux would be an easier road to hoe here. I have zero experience with MATLAB. From what you said at the onset, you seem to be porting a Linux-based build to OS X which might be a big undertaking.

0 Kudos
mecej4
Honored Contributor III
2,025 Views

On Windows, Matlab 2015a, I can see MXCOPYINTEGER4TOPTR in libmx.lib. This suggests that, because you are not able to use --start-group and --end-group, you may need to specify -lmx a second time, after -lut. Note that, not having a Mac, I am guessing in the dark here.

0 Kudos
Jakob_E_
Beginner
2,025 Views

Hi again

Thanks everyone for your help! I installet linux and ran it from there instead, works fine!

regards

0 Kudos
Kevin_D_Intel
Employee
2,025 Views

Glad to hear it. Good job.

0 Kudos
Reply