On 06-05-2014 19:11, Alexander Hansen wrote:
On 5/6/14, 9:36 AM, Luigi Ernesto Zanotti wrote:
Hello,
I have a macro for Root in which the following module is invoked:
gMinuit->mnerrs(1, errp, errm, errpar, gcc);
and everithing is OK. But the fitting is slow, so I turned to a compiled
version:
#include "TMinuit.h"
......
......
gMinuit->mnerrs(1, errp, errm, errpar, gcc);
and compiling with -v option:
`root-config --cxx`-v -o aaa `root-config --glibs --cflags` aaa.cpp
I get the following error:
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
-cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -main-file-name aaa.cpp
-mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -target-linker-version 236.3 -v
-resource-dir
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1
-I /sw/include/root -stdlib=libc++ -stdlib=libc++ -fdeprecated-macro
-fdebug-compilation-dir
/Users/luigiernesto/Desktop/Esame-Info-2013-14/Correlation_did
-ferror-limit 19 -fmessage-length 100 -pthread -stack-protector 1
-mstackrealign -fblocks -fobjc-runtime=macosx-10.9.0
-fencode-extended-block-signature -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
/var/folders/vy/g5r_70497y7gfhjhtpqn91q00000gn/T/aaa-4a67c9.o -x c++
aaa.cpp
clang -cc1 version 5.1 based upon LLVM 3.4svn default target
x86_64-apple-darwin13.1.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
/sw/include/root
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
-demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o aaa
-L/sw/lib/root -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d
-lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore
-lThread -lpthread -lm -ldl
/var/folders/vy/g5r_70497y7gfhjhtpqn91q00000gn/T/aaa-4a67c9.o -lc++
-lSystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
"_gMinuit", referenced from:
_main in aaa-4a67c9.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Any sggestion or help is welcome. Thanks in advance!
Luigi Zanotti
OSX 10.9.2 - Xcode 5.1.1
CLT:
package-id: com.apple.pkg.CLTools_Executables
version: 5.1.0.0.1.1396320587
fink:
Package manager version: 0.36.4.1
Distribution version: selfupdate-cvs Wed Apr 23 10:55:34 2014, 10.9,
x86_64
Trees: local/main stable/main
This list focuses on general issues with respect to building and, to a
lesser degree, using Fink packages, so please don't assume that we
know anything in depth about any particular package, or even have it
installed to look stuff up. Technical usage questions are best
handled by the package's maintainer.
Some information that might help us would be:
1) Is TMinuit.h installed by root5?
2) Is _gMinuit defined in one of the libraries from root5-shlibs?
3) What do "root-config --cxx" and "root-config --glibs --cflags"
actually return?
My guess is that your compiler command isn't providing the path to the
ROOT libraries, and that's why the symbol isn't defined.
You were right. In fact libMinuit is NOT in the list generated by
--glibs, and I did'nt notice that; it must be added manually in the
compile command line.
Many thanks again. Yours,
Luigi Zanotti
--
Prof. Luigi E. Zanotti
Physics Department "G. Occhialini"
University of Milano-Bicocca & INFN
Piazza della Scienza 3 - 20126 Milano Italy
Tel. +39 02 6448 2413
Cell.: +39 349 0997239
e-Mail luigi.zano...@mib.infn.it
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Fink-users mailing list
Fink-users@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.macosx.fink.user
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-users