Menu

Single-zone code with user routines not compiling

2015-10-28
2015-11-12
  • Bradley S. Meyer

    Copied from this post:

    Dear Sir,
    I have tried that post for many times, but I still can not solve the problem to run the run_single_zone.
    I have gone to search the problem in google, it is said maybe the pboblem is from XCODE of MAC. I have tried to modified the Xcode, but it still does not work.
    Many thanks if you could give me some advice on how to solve the problem.
    Undefined symbols for architecture x8664:
    "myuser::getnucnet(int, char)", referenced from:
    main in runsinglezone.o
    "myuser::initializezone(nnt::Zone&, char)", referenced from:
    main in runsinglezone.o
    "myuser::updatezoneproperties(nnt::Zone&)", referenced from:
    main in runsinglezone.o
    "myuser::setzone(Libnucnet, nnt::Zone&, char)", referenced from:
    main in runsinglezone.o
    ld: symbol(s) not found for architecture x8664
    collect2: error: ld returned 1 exit status
    make:
    [runsinglezone] Error 1
    I run this and got permition below:
    $ ./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml my_output.xml "[z < 10]"
    -bash: ./run_single_zone: Operation not permitted

     
    • Bradley S. Meyer

      It does not look like a problem with your computer, but let us first check that. Please confirm that you can carry out the steps in this post.

       
      • Anonymous

        Anonymous - 2015-10-30

        I have done that before and today I run it again. Part of the results I attach belpw:

        t = 7.4248e+16, dt = 9.6842e+15, t9 = 1.5000e-02, rho (g/cc) = 1.5000e+02

        1    2    1.857777e-18   -1.323969e-19
        1    3    1.127922e-26   -1.534207e-28
        2    3    6.277725e-06   -5.388876e-07
        3    6    8.095292e-27    6.080778e-28
        3    7    1.943374e-16    1.424896e-17
        4    7    1.672128e-10    1.216716e-12
        5    8    5.222134e-20   -3.314738e-21
        6   11    8.620500e-23    8.620500e-23
        1    1    5.131030e-01   -3.656876e-02
        2    4    1.217196e-01    9.142595e-03
        

        1 - xsum = -4.440892e-16

        Ye = 0.756555

        t = 3.1500e+17, dt = 2.3829e+16, t9 = 1.5000e-02, rho (g/cc) = 1.5000e+02

        1    2    6.254704e-19   -5.065809e-20
        1    3    7.689572e-27   -3.213715e-28
        2    3    1.440808e-06   -1.817977e-07
        3    6    1.375583e-26    2.327563e-28
        3    7    2.524727e-16   -4.817427e-18
        4    7    7.313200e-11   -7.432107e-12
        5    8    7.688930e-21   -1.467486e-21
        6   11    1.576268e-22    1.576268e-22
        1    1    1.727366e-01   -1.399156e-02
        2    4    2.068148e-01    3.498027e-03
        

        1 - xsum = -2.220446e-16

        Ye = 0.586369

        But when I build my own "Defining your own thermodynamic trajectory function" as this page instructs me. I can not get the results and always get the errors below as the same as before:

        Undefined symbols for architecture x86_64:
        "my_user::get_nucnet(int, char)", referenced from:
        _main in run_single_zone.o
        "my_user::initialize_zone(nnt::Zone&, char
        )", referenced from:
        _main in run_single_zone.o
        "my_user::update_zone_properties(nnt::Zone&)", referenced from:
        _main in run_single_zone.o
        "my_user::set_zone(Libnucnet, nnt::Zone&, char)", referenced from:
        _main in run_single_zone.o
        ld: symbol(s) not found for architecture x86_64
        collect2: error: ld returned 1 exit status
        make:
        [run_single_zone] Error 1

        I am really sorry I can not solve it and ask you so many times.

         
        • Bradley S. Meyer

          Let's try the following. Change into your nucnet-tools-code directory. Save your my_user and my_examples directories by typing:

          mv my_user my_user_old
          mv my_examples my_examples_old

          Next, put the attached rproc.tar in this directory (nucnet-tools-code) and type:

          tar xvf rproc.tar

          Now change into my_examples/network and compile:

          cd my_examples/network
          make run_single_zone

          That should work. You can compare the files in my_examples to those in my_examples_old and in my_user to those in my_user_old to see if you can find differences that would explain your compilation difficulties. For example, in my_user you could type;

          diff my_hydro.cpp ../my_user_old/my_hydro.cpp

          or in my_examples/network you could type:

          diff run_single_zone.cpp ../../my_examples_old/network/run_single_zone.cpp

           
  • Anonymous

    Anonymous - 2015-11-01

    Dear Meyer,
    I have tried as you instructed me above and the results is the same:

    Undefined symbols for architecture x86_64:
    "my_user::get_nucnet(int, char)", referenced from:
    _main in run_single_zone.o
    "my_user::initialize_zone(nnt::Zone&, char
    )", referenced from:
    _main in run_single_zone.o
    "my_user::update_zone_properties(nnt::Zone&)", referenced from:
    _main in run_single_zone.o
    "my_user::set_zone(Libnucnet, nnt::Zone&, char)", referenced from:
    _main in run_single_zone.o
    ld: symbol(s) not found for architecture x86_64
    collect2: error: ld returned 1 exit status
    make:
    [run_single_zone] Error 1

    My Mac is the new kind of newest Macbook. I do not know whether this is the cause of the problem.
    I have tried the same ways as you told me above by borrowing from my friend's successfully running my_example and my_user.
    So many thanks to try to find so many ways for me to solve the problem.

     
    • Bradley S. Meyer

      Ok, just so I know, could you please send me the information about your computer (the info you get by clicking on the About This Mac under the Apple icon)? I'll try to reproduce this if I can find a similar system.

       
  • Anonymous

    Anonymous - 2015-11-02

    Dear Meyer,
    Thanks so much and I attach the overview of the Macbook and the hardware system is below:

    Model Name: MacBook
    Model Identifier: MacBook8,1
    Processor Name: Intel Core M
    Processor Speed: 1.2 GHz
    Number of Processors: 1
    Total Number of Cores: 2
    L2 Cache (per Core): 256 KB
    L3 Cache: 4 MB
    Memory: 8 GB
    Boot ROM Version: MB81.0164.B06
    SMC Version (system): 2.25f86

    the web for macbook from apple page:
    https://www.apple.com/macbook/

    Thanks very much

     
  • Bradley S. Meyer

    Could you try the following in your compilation directory:

    gcc -v >& log1
    make clean
    make run_single_zone >& log2

    Attach log1 and log2 in your reply. Thanks.

     
  • Anonymous

    Anonymous - 2015-11-05

    Dear Meyer,
    Log1 is below and I attached the log1 and log2 files below.
    Thanks very much for your such pacient check.

    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin14/4.9.3/lto-wrapper
    Target: x86_64-apple-darwin14
    Configured with: /opt/local/var/macports/build/_opt_mports_dports_lang_gcc49/gcc49/work/gcc-4.9.3/configure --prefix=/opt/local --build=x86_64-apple-darwin14 --enable-languages=c,c++,objc,obj-c++,lto,fortran,java --libdir=/opt/local/lib/gcc49 --includedir=/opt/local/include/gcc49 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.9 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.9 --with-gxx-include-dir=/opt/local/include/gcc49/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --disable-isl-version-check --with-cloog=/opt/local --disable-cloog-version-check --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --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 --with-pkgversion='MacPorts gcc49 4.9.3_0'
    Thread model: posix
    gcc version 4.9.3 (MacPorts gcc49 4.9.3_0)

     
    • Bradley S. Meyer

      It looks like your my_hydro.cpp is not in the my_user directory. Please go through the steps of the blog post carefully again. In particular, make sure that you have the my_user and my_examples directories, and make sure that my_user contains the files Makefile.inc, my_hydro.cpp, and my_hydro.h.

      To confirm all this, feel free to do

      cd nucnet-tools-code
      tar cvf rproc.tar my_user my_examples
      gzip rproc.tar

      and attach rproc.tar.gz in your reply.

       
      • Anonymous

        Anonymous - 2015-11-06

        Dear Meyer,
        I have tar all the file into the rproc.tar.gz as you guild me to do below.
        I have the my_hydro.cpp file in my computer, and other files is also in.

         
        • Bradley S. Meyer

          I downloaded your rproc.tar.gz to my nucnet-tools-code directory. I then did the following:

          rm -fr my_examples my_user
          tar zxvf rproc.tar.gz
          cd my_examples/network
          make clean
          make run_single_zone
          ./run_single_zone ../../data_pub/my_net.xml ../../data_pub/zone.xml my_output.xml "[z < 10]" none

          Everything worked fine.

           
          • Anonymous

            Anonymous - 2015-11-11

            So many tahanks

             
            • Bradley S. Meyer

              Did it finally work?

               
  • Anonymous

    Anonymous - 2015-11-12

    Dear Sir, It finally work, I have reinstalled my mac system and it finally work. Thanks very much. If I have other problems, I will ask you again. Sorry for so many questions.

     
    • Bradley S. Meyer

      I'm glad to hear it, and questions are always welcome. Best wishes.

       

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.