make fails with "undefined reference to..."


 
Thread Tools Search this Thread
Top Forums Programming make fails with "undefined reference to..."
# 1  
Old 10-18-2011
make fails with "undefined reference to..."

i am compiling a program called vasp on suse and get the following error. there are many more preprocess and ifort commands prior so i just grabbed the tail of the log file:

Code:
./preprocess <main.F | /usr/bin/cpp -P -C -traditional >main.f90 -DMPI  -DHOST=\"LinuxIFC\" -DIFC -Dkind8 -DNGZhalf -DCACHE_SIZE=4000 -DPGF90 -Davoidalloc -DMPI_BLOCK=500 -DRPROMU_DGEMV  -DRACCMU_DGEMV
ifort -FR -lowercase -assume byterecl -I/usr/apps/vasp/4.6/fftw-3.3/include -I/usr/apps/vasp/4.6/mpich2-1.2.1p1/include-FR -O0   -c main.f90
rm -f vasp
ifort -o vasp  main.o  base.o     mpi.o      smart_allocate.o      xml.o constant.o jacobi.o   main_mpi.o  scala.o asa.o      lattice.o  poscar.o   ini.o      setex.o     radial.o pseudo.o   mgrid.o    mkpoints.o wave.o      wave_mpi.o  symmetry.o symlib.o   lattlib.o  random.o    nonl.o     nonlr.o    dfast.o    choleski2.o mix.o      charge.o   xcgrad.o   xcspin.o    potex1.o   potex2.o metagga.o  constrmag.o pot.o      cl_shift.o force.o    dos.o      elf.o tet.o      hamil.o    steep.o chain.o    dyna.o     relativistic.o LDApU.o sphpro.o  paw.o   us.o ebs.o      wavpre.o   wavpre_noio.o broyden.o dynbr.o    rmm-diis.o reader.o   writer.o   tutor.o xml_writer.o brent.o    stufak.o   fileio.o   opergrid.o stepver.o dipol.o    xclib.o    chgloc.o   subrot.o   optreal.o   davidson.o edtest.o   electron.o shm.o      pardens.o  paircorrection.o optics.o   constr_cell_relax.o   stm.o    finite_diff.o elpol.o    setlocalpp.o aedens.o    fftw3d.o fft3dlib.o   /usr/apps/vasp/4.6/fftw-3.3/lib/libfftw3.a -L../vasp.4.lib -ldmy ../vasp.4.lib/linpack_double.o ../vasp.4.lib/lapack_double.o /usr/apps/vasp/4.6/atlas/lib/libf77blas.a /usr/apps/vasp/4.6/atlas/lib/libatlas.a  /usr/apps/vasp/4.6/mpich2-1.2.1p1/lib/libmpich.a /usr/apps/vasp/4.6/mpich2-1.2.1p1/lib/libfmpich.a /usr/apps/vasp/4.6/mpich2-1.2.1p1/lib/libmpichf90.a /usr/apps/vasp/4.6/mpich2-1.2.1p1/lib/libmpichcxx.a /usr/apps/vasp/4.6/mpich2-1.2.1p1/lib/libopa.a
main.o: In function `MAIN__':
main.f90:(.text+0x13af3): undefined reference to `mapset_'
main.f90:(.text+0x13b68): undefined reference to `mapset_'
main.f90:(.text+0x13b77): undefined reference to `mapset_'
main.f90:(.text+0x13bec): undefined reference to `mapset_'
make: *** [vasp] Error 1

any insight would be appreciated.
# 2  
Old 10-18-2011
It's trying to use a variable or function called 'mapset' which does not exist.
# 3  
Old 10-18-2011
i probably should have mentioned i am not a programmer of this type. so although the error is somewhat clear i am certainly not clear on how i might go about "fixing" it. any suggestions would be greatly appreciated.
# 4  
Old 10-18-2011
Neither am I, but this error is common to most languages with a linking step.

this seems to be related. You don't get mapset without certain options.
# 5  
Old 10-18-2011
thanx, but i already had this come up in a google search. i tried to map the thread to my issue to understand what is wrong with no luck. i clearly need more hand holding than what that page offered.
# 6  
Old 10-18-2011
I'm not withholding the answer. I have no more information and no means to test with.
This User Gave Thanks to Corona688 For This Post:
# 7  
Old 10-19-2011
i know you're not as most folks here don't. i was just stating a fact. i've already tried a few different things and failed. i'll keep at it and if get it figured out or someone rescues me i'll be sure to post. thanx for chiming in though, always appreciated.

---------- Post updated at 10:03 AM ---------- Previous update was at 10:02 AM ----------

corona688, you got me thinking about it so i started digging deeper. i found a file in the same dir that actually defined the mapset subroutine. so i checked to see if this file was part of the whole compilation process and it was not as it had no equivalent .o file. so that got me to dig even deeper. i then discovered that the makefile defines which files in that dir actually get processed and then get included in the "make"ing of the executable. that one file was missing. once i included it the error disappeared and in its place the executable. thanx for the spark! take care.
This User Gave Thanks to crimso For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Compiling C++ code with NetCDF libraries: "undefined reference"

Hi! I am trying to compile a C++ code with cmake and gcc on Ubuntu. The code uses NetCDF4 libraries. I specify the path to these libraries as follows: -I/usr/local/include -L/usr/local/lib -lnetcdf -lnetcdf_c++4 "ccmake" and "cmake" work fine. After typing "make" I receive the error... (0 Replies)
Discussion started by: Alauda
0 Replies

2. Emergency UNIX and Linux Support

Perl error: Can't call method "value" on an undefined value

Hi, I am running a perl script to automate a process and I keep running into a error can't find the "value" Can't call method "value" on an undefined value at process_file.pl line 44. file is CVS cell is ifdfdxrfmp.ksh Here is the script I have also attached it as well: ... (2 Replies)
Discussion started by: vpundit
2 Replies

3. Solaris

I got "undefined reference to" on gcc

Hell all I tryed to build rmp from sources on Solaris 10. I download source code, install gcc, binutils, and other packs с sunfreeware.com. Doring compilation I got an error: /bin/bash ./libtool --tag=CC --mode=link gcc -std=gnu99 -g -O2 -fPIC -DPIC -D_REENTRANT -Wall... (0 Replies)
Discussion started by: sluge
0 Replies

4. Programming

"make" fails on the first .f90 file it encounters: not creating .o files

i may be asking way too much here but i am not a programmer and not sure where to to turn. i have a program that i am trying to "make". but the compiler i am supposed to use gets nowhere. there are a bunch of .f90 files that are being processed as follows but it doesn't get past the first one: ... (1 Reply)
Discussion started by: crimso
1 Replies

5. Shell Programming and Scripting

Make scipt except from "Y","y" and "yes" to take [Enter] as being "yes"

This is the script: #!/bin/sh if ; then rm -rf /usr/share/WallpaperChanger; fi if ; then rm -rf /usr/bin/wallch; fi; if ; then rm -rf /usr/share/applications/wallch.desktop; fi if ; then rm -rf /usr/share/doc/wallch; fi if ; then rm -rf /usr/share/man/man1/wallch.1.gz; fi echo "Delete... (4 Replies)
Discussion started by: hakermania
4 Replies

6. Programming

compile fails in linux ... "No rule to make target" ... HELP

hello all, attached you can find a tool (written in C) that i really need to make it compile under linux i am able to compile and run it successfully in mac os x, but in linux the compilation fails the only thing that i did so far is to change the following #include <sys/malloc.h> to... (13 Replies)
Discussion started by: OneDreamCloser
13 Replies

7. UNIX for Dummies Questions & Answers

#!/bin/sh script fails at StringA | tr "[x]" "[y]"

I need to take a string (stringA) check it for spaces and replace any spaces found with an equal (=) sign. This is not working. There are spaces between each component: $StringA | tr "" "" The error returned is: test: Specify a parameter with this command Can you help? (3 Replies)
Discussion started by: by_tg
3 Replies

8. AIX

Getting error "Undefined symbol: .u_strlen_2_6"

Hi, I am using xlC compiler. The compilation goes fine but at the time of linking it gives the following error ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. ld: 0711-317 ERROR: Undefined symbol: .u_strlen_2_6 ld: 0711-317 ERROR: Undefined symbol:... (0 Replies)
Discussion started by: nachiketv
0 Replies

9. Programming

how could i make a program mixed with many "|", "<" and ">"

I have written following code to do: ls -l | wc -w, it works: but when there are not only a single "|", if there are more such as: ls -l | sort -r | sort | sort -r, This program does not work, i want to know how could i deal with it when there are more "|", another situation is that, if it mixes... (2 Replies)
Discussion started by: strugglingman
2 Replies

10. Programming

shared object "undefined symbol: fstat" error

Didn't have this problem in AIX, but ported to Linux with GCC compiler and am now getting a runtime error: tssutil: symbol lookup error: /work/agility/devel/bin/libagam.so: undefined symbol: fstat I'm sure most of you know that fstat is an intrinsic function just like printf, memcpy, etc. When I... (5 Replies)
Discussion started by: marcus121
5 Replies
Login or Register to Ask a Question