Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue with jl.config #50

Open
Hadrien-Montanelli opened this issue Aug 15, 2017 · 2 comments
Open

Build issue with jl.config #50

Hadrien-Montanelli opened this issue Aug 15, 2017 · 2 comments

Comments

@Hadrien-Montanelli
Copy link

I'm running MATLAB R2017a and Julia 0.6 on Yosemite 10.10.5.

Here is the error I get with jl.config:

>> jl.config('/Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia')
         build_cflags: '-O -I"/Applications/Julia-0.6.app/Contents/Resources/julia/include/julia" -DJULIA_ENABLE_THREADING'
        build_ldflags: '-L"/Applications/Julia-0.6.app/Contents/Resources/julia/lib" -Wl,-rpath="/Applications/Julia-0.6.app/Contents/Resources/julia/lib"'
         build_ldlibs: '-ljulia -ldl'
            build_src: '/Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.cpp'
              inc_dir: '/Applications/Julia-0.6.app/Contents/Resources/julia/include/julia'
             is_debug: 'false'
            julia_bin: '/Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia'
           julia_home: '/Applications/Julia-0.6.app/Contents/Resources/julia/bin'
             lib_base: 'julia'
              lib_dir: '/Applications/Julia-0.6.app/Contents/Resources/julia/lib'
             lib_path: '/Applications/Julia-0.6.app/Contents/Resources/julia/lib/libjulia.0.6.0.dylib'
            sys_image: '/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib'
    threading_enabled: 'true'

The mex command to be executed:
mex LDFLAGS='-L"/Applications/Julia-0.6.app/Contents/Resources/julia/lib" -Wl,-rpath="/Applications/Julia-0.6.app/Contents/Resources/julia/lib" $LDFLAGS' -v -largeArrayDims -outdir "/Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA" -O -I"/Applications/Julia-0.6.app/Contents/Resources/julia/include/julia" -DJULIA_ENABLE_THREADING /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.cpp -ljulia -ldl
Verbose mode is on.
... Looking for compiler 'Xcode Clang++' ...
... Looking for environment variable 'DEVELOPER_DIR' ...No.
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer' ...Yes.
... Executing command 'which xcrun' ...Yes ('/usr/bin/xcrun').
... Looking for folder '/usr/bin' ...Yes.
... Executing command 'defaults read com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense' ...No.
... Executing command 'defaults read /Library/Preferences/com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense' ...Yes ('7.0').
... Executing command '
agreed=7.0 
 if echo $agreed | grep -E '[\.\"]' >/dev/null; then 
 lhs=`expr "$agreed" : '\([0-9]*\)[\.].*'` 
  rhs=`expr "$agreed" : '[0-9]*[\.]\(.*\)$'` 
 if echo $rhs | grep -E '[\."]' >/dev/null; then 
 rhs=`expr "$rhs" : '\([0-9]*\)[\.].*'` 
 fi 
 if [ $lhs -gt 4 ] || ( [ $lhs -eq 4 ] && [ $rhs -ge 3 ] ); then 
 echo $agreed 
 else 
 exit 1
 fi 
 fi' ...Yes ('7.0').
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk' ...Yes.
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk' ...Yes.
... Executing command 'echo /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk | rev | cut -c1-10 | rev | egrep -oh '[0-9]+\.[0-9]+'' ...Yes ('10.11').
Found installed compiler 'Xcode Clang++'.
Options file details
-------------------------------------------------------------------
	Compiler location: /Applications/Xcode.app/Contents/Developer
	Options file: /Users/montanelli/Library/Application Support/MathWorks/MATLAB/R2017a/mex_C++_maci64.xml
	CMDLINE200 : /usr/bin/xcrun -sdk macosx10.11 clang++ -L"/Applications/Julia-0.6.app/Contents/Resources/julia/lib" -Wl,-rpath="/Applications/Julia-0.6.app/Contents/Resources/julia/lib" -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.11 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -framework Cocoa -bundle  -Wl,-exported_symbols_list,"/Applications/MATLAB_R2017a.app/extern/lib/maci64/mexFunction.map" -stdlib=libc++ -O -Wl,-exported_symbols_list,"/Applications/MATLAB_R2017a.app/extern/lib/maci64/mexFunction.map" /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/mexjulia.o /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/cpp_mexapi_version.o   -ljulia  -ldl   -L"/Applications/MATLAB_R2017a.app/bin/maci64" -lmx -lmex -lmat -o /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.mexmaci64
	CXX : /usr/bin/xcrun -sdk macosx10.11 clang++
	DEFINES : -DTARGET_API_VERSION=700  -DJULIA_ENABLE_THREADING  -DMX_COMPAT_64  -DUSE_MEX_CMD   -DMATLAB_MEX_FILE 
	MATLABMEX : -DMATLAB_MEX_FILE 
	CXXFLAGS : -fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fobjc-arc -std=c++11 -stdlib=libc++
	INCLUDE : -I"/Applications/Julia-0.6.app/Contents/Resources/julia/include/julia"  -I"/Applications/MATLAB_R2017a.app/extern/include" -I"/Applications/MATLAB_R2017a.app/simulink/include"
	CXXOPTIMFLAGS : -O2 -DNDEBUG
	CXXDEBUGFLAGS : -g
	LDXX : /usr/bin/xcrun -sdk macosx10.11 clang++
	LDFLAGS : -L"/Applications/Julia-0.6.app/Contents/Resources/julia/lib" -Wl,-rpath="/Applications/Julia-0.6.app/Contents/Resources/julia/lib" -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.11 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -framework Cocoa -bundle  -Wl,-exported_symbols_list,"/Applications/MATLAB_R2017a.app/extern/lib/maci64/mexFunction.map" -stdlib=libc++
	LDBUNDLE : -bundle 
	LINKEXPORT : -Wl,-exported_symbols_list,"/Applications/MATLAB_R2017a.app/extern/lib/maci64/mexFunction.map"
	LINKLIBS : -ljulia  -ldl   -L"/Applications/MATLAB_R2017a.app/bin/maci64" -lmx -lmex -lmat
	LDOPTIMFLAGS : -O
	LDDEBUGFLAGS : -g
	OBJEXT : .o
	LDEXT : .mexmaci64
	DEVELOPER_DIR_CHECK : 
	XCODE_DIR : /Applications/Xcode.app/Contents/Developer
	XCRUN_DIR : /usr/bin
	XCODE_AGREED_VERSION : 7.0
	ISYSROOT : /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
	SDKVER : 10.11
	MATLABROOT : /Applications/MATLAB_R2017a.app
	ARCH : maci64
	SRC : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.cpp;/Applications/MATLAB_R2017a.app/extern/version/cpp_mexapi_version.cpp
	OBJ : /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/mexjulia.o;/var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/cpp_mexapi_version.o
	OBJS : /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/mexjulia.o /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/cpp_mexapi_version.o 
	SRCROOT : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia
	DEF : /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/mexjulia.def
	EXP : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.exp
	LIB : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.lib
	EXE : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.mexmaci64
	ILK : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.ilk
	MANIFEST : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.mexmaci64.manifest
	TEMPNAME : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia
	EXEDIR : /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/
	EXENAME : mexjulia
	OPTIM : -O2 -DNDEBUG
	LINKOPTIM : -O
	CMDLINE100_0 : /usr/bin/xcrun -sdk macosx10.11 clang++ -c -DTARGET_API_VERSION=700  -DJULIA_ENABLE_THREADING  -DMX_COMPAT_64  -DUSE_MEX_CMD   -DMATLAB_MEX_FILE  -I"/Applications/Julia-0.6.app/Contents/Resources/julia/include/julia"  -I"/Applications/MATLAB_R2017a.app/extern/include" -I"/Applications/MATLAB_R2017a.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fobjc-arc -std=c++11 -stdlib=libc++ -O2 -DNDEBUG /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.cpp -o /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/mexjulia.o
	CMDLINE100_1 : /usr/bin/xcrun -sdk macosx10.11 clang++ -c -DTARGET_API_VERSION=700  -DJULIA_ENABLE_THREADING  -DMX_COMPAT_64  -DUSE_MEX_CMD   -DMATLAB_MEX_FILE  -I"/Applications/Julia-0.6.app/Contents/Resources/julia/include/julia"  -I"/Applications/MATLAB_R2017a.app/extern/include" -I"/Applications/MATLAB_R2017a.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fobjc-arc -std=c++11 -stdlib=libc++ -O2 -DNDEBUG /Applications/MATLAB_R2017a.app/extern/version/cpp_mexapi_version.cpp -o /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/cpp_mexapi_version.o
	CMDLINE300_0 : rm -f /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/mexjulia.o
	CMDLINE300_1 : rm -f /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/cpp_mexapi_version.o
-------------------------------------------------------------------
Building with 'Xcode Clang++'.
/usr/bin/xcrun -sdk macosx10.11 clang++ -c -DTARGET_API_VERSION=700  -DJULIA_ENABLE_THREADING  -DMX_COMPAT_64  -DUSE_MEX_CMD   -DMATLAB_MEX_FILE  -I"/Applications/Julia-0.6.app/Contents/Resources/julia/include/julia"  -I"/Applications/MATLAB_R2017a.app/extern/include" -I"/Applications/MATLAB_R2017a.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fobjc-arc -std=c++11 -stdlib=libc++ -O2 -DNDEBUG /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.cpp -o /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/mexjulia.o
/usr/bin/xcrun -sdk macosx10.11 clang++ -c -DTARGET_API_VERSION=700  -DJULIA_ENABLE_THREADING  -DMX_COMPAT_64  -DUSE_MEX_CMD   -DMATLAB_MEX_FILE  -I"/Applications/Julia-0.6.app/Contents/Resources/julia/include/julia"  -I"/Applications/MATLAB_R2017a.app/extern/include" -I"/Applications/MATLAB_R2017a.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.11 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -fobjc-arc -std=c++11 -stdlib=libc++ -O2 -DNDEBUG /Applications/MATLAB_R2017a.app/extern/version/cpp_mexapi_version.cpp -o /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/cpp_mexapi_version.o
/usr/bin/xcrun -sdk macosx10.11 clang++ -L"/Applications/Julia-0.6.app/Contents/Resources/julia/lib" -Wl,-rpath="/Applications/Julia-0.6.app/Contents/Resources/julia/lib" -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.11 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -framework Cocoa -bundle  -Wl,-exported_symbols_list,"/Applications/MATLAB_R2017a.app/extern/lib/maci64/mexFunction.map" -stdlib=libc++ -O -Wl,-exported_symbols_list,"/Applications/MATLAB_R2017a.app/extern/lib/maci64/mexFunction.map" /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/mexjulia.o /var/folders/06/04hqnrr559l_w_vfs27k3yrw0000gn/T/mex_71500059142805_5703/cpp_mexapi_version.o   -ljulia  -ldl   -L"/Applications/MATLAB_R2017a.app/bin/maci64" -lmx -lmex -lmat -o /Users/montanelli/Dropbox/HM/WORK/MATLAB/MEXJULIA/mexjulia.mexmaci64
Error using mex
ld: unknown option: -rpath=/Applications/Julia-0.6.app/Contents/Resources/julia/lib
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Error in jl.build (line 288)
            eval(mex_cmd);

Error in jl.config (line 268)
            jl.build;
@twadleigh
Copy link
Collaborator

The relevant line seems to be:

ld: unknown option: -rpath=/Applications/Julia-0.6.app/Contents/Resources/julia/lib

Could it be that the compiler doesn't like the =? Maybe try replacing it with a space here: https://github.com/twadleigh/mexjulia/blob/26c729ed5e77030452f5de629bf68ee3ccc88b65/jl.m#L232

@Hadrien-Montanelli
Copy link
Author

Yes, it works now. Thank you @twadleigh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants