Giter Club home page Giter Club logo

Comments (14)

tonigi avatar tonigi commented on September 22, 2024 1

For anybody passing by here: for some reason I am still getting the error (MacOS 12.6, M1). Some success with the following change, which incidentally links against the VMD-supplied Tcl library.

VMDDIR="/Applications/VMD 1.9.4a57-arm64-Rev12.app/Contents/vmd"
PLUGINDIR=$(VMDDIR)/plugins/MACOSXARM64/tcl
FRAMEWORK=-F $(VMDDIR)/../Frameworks -framework Tcl

CPPFLAGS=-fpic -O3 -Wall ${TCLINC} -DVERSION=\"${VERSION}\"

qwrap.so: qwrap.o
       $(CXX) -dynamiclib -DUSE_TCL_STUBS $< $(FRAMEWORK) -o $@

from qwrap.

jhenin avatar jhenin commented on September 22, 2024

What is the error message?

from qwrap.

georopon avatar georopon commented on September 22, 2024

not -fno- scope

from qwrap.

jhenin avatar jhenin commented on September 22, 2024

I can't find this error message anywhere. Check that it is exactly the error that you get. Please copy and paste a larger block of output messages to give me more info.

from qwrap.

balazsfabian avatar balazsfabian commented on September 22, 2024

I have the same issue on my mac:

c++  -fpic -O3 -Wall -ansi -pedantic -fno-for-scope -I/usr/include/tcl8.6 -DVERSION=\"1.4\"  -c -o qwrap.o qwrap.cpp
clang: error: the clang compiler does not support '-fno-for-scope'
make: *** [qwrap.o] Error 1

Indeed, there is not much to go on when one tries to google this.
Obviously, without the -fno-for-scope all hell breaks loose.

from qwrap.

jhenin avatar jhenin commented on September 22, 2024

Thanks @balazsfabian for this info. Can you change line 8 of the Makefile with this:
CPPFLAGS=-fpic -O3 -Wall ${TCLINC} -DVERSION=\"${VERSION}\"
and see if that helps?

from qwrap.

balazsfabian avatar balazsfabian commented on September 22, 2024

Changing the CPPFLAGS resulted in

c++  -fpic -O3 -Wall -I/usr/include/tcl8.6 -DVERSION=\"1.4\"  -c -o qwrap.o qwrap.cpp
llvm-g++ -shared qwrap.o -o qwrap.so -I/usr/lib64
Undefined symbols for architecture arm64:
  "_TclFreeObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_AppendPrintfToObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_AppendToObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_CreateObjCommand", referenced from:
      _Qwrap_Init in qwrap.o
  "_Tcl_DuplicateObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_EvalEx", referenced from:
      _Qwrap_Init in qwrap.o
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_EvalObjEx", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_EvalObjv", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_GetByteArrayFromObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_GetDoubleFromObj", referenced from:
      parse_vector(Tcl_Obj*, std::__1::vector<float, std::__1::allocator<float> >&, Tcl_Interp*) in qwrap.o
      parse_ivector(Tcl_Obj*, std::__1::vector<int, std::__1::allocator<int> >&, Tcl_Interp*, bool) in qwrap.o
  "_Tcl_GetIntFromObj", referenced from:
      parse_ivector(Tcl_Obj*, std::__1::vector<int, std::__1::allocator<int> >&, Tcl_Interp*, bool) in qwrap.o
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_GetObjResult", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_GetString", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_InvalidateStringRep", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_ListObjGetElements", referenced from:
      parse_vector(Tcl_Obj*, std::__1::vector<float, std::__1::allocator<float> >&, Tcl_Interp*) in qwrap.o
      parse_ivector(Tcl_Obj*, std::__1::vector<int, std::__1::allocator<int> >&, Tcl_Interp*, bool) in qwrap.o
  "_Tcl_NewIntObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_NewStringObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_ObjPrintf", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_SetResult", referenced from:
      parse_vector(Tcl_Obj*, std::__1::vector<float, std::__1::allocator<float> >&, Tcl_Interp*) in qwrap.o
      parse_ivector(Tcl_Obj*, std::__1::vector<int, std::__1::allocator<int> >&, Tcl_Interp*, bool) in qwrap.o
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_WrongNumArgs", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [qwrap.so] Error 1

from qwrap.

jhenin avatar jhenin commented on September 22, 2024

Please try with the version of the Makefile I just pushed. Thanks.

from qwrap.

balazsfabian avatar balazsfabian commented on September 22, 2024

Issue solved, the compiler is happy now (and so am I). Thanks a lot!

from qwrap.

jhenin avatar jhenin commented on September 22, 2024

Thank you again for your report!

from qwrap.

jhenin avatar jhenin commented on September 22, 2024

Hi @balazsfabian , would you mind testing this variant of the Makefile for me?
Makefile.test.gz

Here I'm not linking explicitly with Tcl, but suppressing the unresolved symbol errors from the linker. I'd rather not link explicitly with the system library if I can avoid it.

from qwrap.

balazsfabian avatar balazsfabian commented on September 22, 2024

Hi @jhenin!

I tried the new make file. Here is the result:

g++ -shared qwrap.o -o qwrap.so -L/usr/lib64
ld: warning: directory not found for option '-L/usr/lib64'
Undefined symbols for architecture arm64:
  "_TclFreeObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_AppendPrintfToObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_AppendToObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_CreateObjCommand", referenced from:
      _Qwrap_Init in qwrap.o
  "_Tcl_DuplicateObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_EvalEx", referenced from:
      _Qwrap_Init in qwrap.o
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_EvalObjEx", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_EvalObjv", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_GetByteArrayFromObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_GetDoubleFromObj", referenced from:
      parse_vector(Tcl_Obj*, std::__1::vector<float, std::__1::allocator<float> >&, Tcl_Interp*) in qwrap.o
      parse_ivector(Tcl_Obj*, std::__1::vector<int, std::__1::allocator<int> >&, Tcl_Interp*, bool) in qwrap.o
  "_Tcl_GetIntFromObj", referenced from:
      parse_ivector(Tcl_Obj*, std::__1::vector<int, std::__1::allocator<int> >&, Tcl_Interp*, bool) in qwrap.o
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_GetObjResult", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_GetString", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_InvalidateStringRep", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_ListObjGetElements", referenced from:
      parse_vector(Tcl_Obj*, std::__1::vector<float, std::__1::allocator<float> >&, Tcl_Interp*) in qwrap.o
      parse_ivector(Tcl_Obj*, std::__1::vector<int, std::__1::allocator<int> >&, Tcl_Interp*, bool) in qwrap.o
  "_Tcl_NewIntObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_NewStringObj", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_ObjPrintf", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_SetResult", referenced from:
      parse_vector(Tcl_Obj*, std::__1::vector<float, std::__1::allocator<float> >&, Tcl_Interp*) in qwrap.o
      parse_ivector(Tcl_Obj*, std::__1::vector<int, std::__1::allocator<int> >&, Tcl_Interp*, bool) in qwrap.o
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
  "_Tcl_WrongNumArgs", referenced from:
      do_qwrap(void*, Tcl_Interp*, int, Tcl_Obj* const*, bool) in qwrap.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [qwrap.so] Error 1

from qwrap.

jhenin avatar jhenin commented on September 22, 2024

Thanks for testing. I find this behavior of the linker annoying, but I don't see a better workaround for now, so let's keep it as is.

from qwrap.

jhenin avatar jhenin commented on September 22, 2024

Thanks @tonigi !

from qwrap.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.