[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Getfem-users] how to compile my own program?
From: |
Martin Genet |
Subject: |
Re: [Getfem-users] how to compile my own program? |
Date: |
Thu, 10 Mar 2011 10:37:11 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 |
Hi,
On 03/09/2011 11:34 PM, Konstantinos Poulios wrote:
On Thu, Mar 10, 2011 at 2:04 AM, Martin Genet<address@hidden> wrote:
I would like to compile my own program based on the GetFEM library. For
instance, I want to start from getfem/tests/laplacian.cc and modify it to
adapt it to my problem.
When I go to getfem/tests, I can run "make laplacian" and then "./laplacian
laplacian.param" and everything works perfectly. But when I move
laplacian.cc and laplacian.param to some directory, I can't manage to
compile it anymore. And I can't find any information about this. What is the
correct way to do it?
you have to edit your makefile and add the adapt/add the appropriate
include options e.g.
-I /path/where/getfem/headers/are/installed/
what kind of OS are you running?
Thanks so much for your help, Kostas.
I am running Linux (Kubuntu 10.10) on my MacBook Pro.
Well, this command works for compiling:
gcc -I./getfem -I./getfem/src -I/usr/local/include -DGMM_USES_BLAS
-DGMM_USES_LAPACK -O3 -c -o test.o test.cc
But this one does not work for linking:
gcc -L/usr/lib -L/usr/local/lib -lgetfem -rdynamic -lsmumps -ldmumps -lcmumps
-lzmumps -lmuparser -lm -lblas -llapack -o test.o test
I receive the following error message:
test: In function `__bss_start':
(*ABS*+0x9ac310): multiple definition of `_edata'
test:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 0 has
invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 1 has
invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 2 has
invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 3 has
invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 4 has
invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 5 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 6 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 7 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 8 has
invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 9 has
invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 10 has
invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 11 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 12 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 13 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 14 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 15 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 16 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 17 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 18 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 19 has
invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 20 has
invalid symbol index 20
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o:(.rodata.cst4+0x0):
first defined here
test: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o:(.fini+0x0): first
defined here
test: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_line): relocation 0 has
invalid symbol index 2
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o:/build/buildd/eglibc-2.12.1/csu/../sysdeps/x86_64/elf/start.S:109:
first defined here
test: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o:(.init+0x0): first
defined here
test: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o:(.data+0x0): first
defined here
test: In function `_end':
(*ABS*+0x9ada30): multiple definition of `_end'
test: In function `__bss_start':
(*ABS*+0x9ac310): multiple definition of `__bss_start'
/usr/bin/ld: warning: Cannot create .eh_frame_hdr section, --eh-frame-hdr
ignored.
/usr/bin/ld: error in test(.eh_frame); no .eh_frame_hdr table will be created.
/usr/local/lib/libgetfem.so: undefined reference to `set_default_options'
/usr/local/lib/libgetfem.so: undefined reference to `cCreate_CompCol_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `zCreate_Dense_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `dCreate_Dense_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `StatFree'
/usr/local/lib/libgetfem.so: undefined reference to `Destroy_CompCol_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `dgssvx'
/usr/local/lib/libgetfem.so: undefined reference to `dCreate_CompCol_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `sCreate_Dense_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `sgssvx'
/usr/local/lib/libgetfem.so: undefined reference to `zgssvx'
/usr/local/lib/libgetfem.so: undefined reference to `StatInit'
/usr/local/lib/libgetfem.so: undefined reference to `Destroy_SuperNode_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `sCreate_CompCol_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `zCreate_CompCol_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `cgssvx'
/usr/local/lib/libgetfem.so: undefined reference to `cCreate_Dense_Matrix'
/usr/local/lib/libgetfem.so: undefined reference to `Destroy_SuperMatrix_Store'
Do you know what I should do to make it right?
Thanks in advance,
Martin.