- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My codebase is split up into groups of subroutines that offer separate functionality, but ultimately make use of the same data set. I'd like to be able to compile each group of subroutines into a shared library, and then have the ability to customize the distribution on a per-user group basis. My thought is to compile a set of "dummy" libraries to satisfy the executable at runtime and gracefully exit the program. Is there any reason why this shouldn't work?
Here's an example of the code I'm using for the dummy library:
---
subroutine subroutine1
USE MODULE1
USE MODULE2
implicit none
write(*,*) 'ERROR: THIS MODULE IS NOT PRESENT'
write(*,*) 'IN THIS DISTRIBUTION OF THE CODE.'
stop
end subroutine subroutine1
---
I'm compiling the shared library with the following command:
ifort -g -O0 -CB -fpic -shared -i-static -module ../../build -o libdummy.so dummy.f90
However, when I try to run the executable (after properly setting $LD_LIBRARY_PATH), I get the following:
./code: symbol lookup error: ./code: undefined symbol: for_concat
Thoughts?
Thanks,
Greg
Here's an example of the code I'm using for the dummy library:
---
subroutine subroutine1
USE MODULE1
USE MODULE2
implicit none
write(*,*) 'ERROR: THIS MODULE IS NOT PRESENT'
write(*,*) 'IN THIS DISTRIBUTION OF THE CODE.'
stop
end subroutine subroutine1
---
I'm compiling the shared library with the following command:
ifort -g -O0 -CB -fpic -shared -i-static -module ../../build -o libdummy.so dummy.f90
However, when I try to run the executable (after properly setting $LD_LIBRARY_PATH), I get the following:
./code: symbol lookup error: ./code: undefined symbol: for_concat
Thoughts?
Thanks,
Greg
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - gregfi04
My codebase is split up into groups of subroutines that offer separate functionality, but ultimately make use of the same data set. I'd like to be able to compile each group of subroutines into a shared library, and then have the ability to customize the distribution on a per-user group basis. My thought is to compile a set of "dummy" libraries to satisfy the executable at runtime and gracefully exit the program. Is there any reason why this shouldn't work?
Here's an example of the code I'm using for the dummy library:
---
subroutine subroutine1
USE MODULE1
USE MODULE2
implicit none
write(*,*) 'ERROR: THIS MODULE IS NOT PRESENT'
write(*,*) 'IN THIS DISTRIBUTION OF THE CODE.'
stop
end subroutine subroutine1
---
I'm compiling the shared library with the following command:
ifort -g -O0 -CB -fpic -shared -i-static -module ../../build -o libdummy.so dummy.f90
However, when I try to run the executable (after properly setting $LD_LIBRARY_PATH), I get the following:
./code: symbol lookup error: ./code: undefined symbol: for_concat
Here's an example of the code I'm using for the dummy library:
---
subroutine subroutine1
USE MODULE1
USE MODULE2
implicit none
write(*,*) 'ERROR: THIS MODULE IS NOT PRESENT'
write(*,*) 'IN THIS DISTRIBUTION OF THE CODE.'
stop
end subroutine subroutine1
---
I'm compiling the shared library with the following command:
ifort -g -O0 -CB -fpic -shared -i-static -module ../../build -o libdummy.so dummy.f90
However, when I try to run the executable (after properly setting $LD_LIBRARY_PATH), I get the following:
./code: symbol lookup error: ./code: undefined symbol: for_concat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
The -i-static option looks like a problem here. I think you would want to leave the linking of Intel run-time libraries until the final link, rather than attempting to link bits of them statically into each of your libraries, even if you are restricting the final link to static only.
Thanks, got it to work.
I took the "-i-static" out of the linker commands for the shared libraries, and included "-static-intel" in the final link statement. However, now it needs /opt/intel/fc/10.1.015/lib to be in $LD_LIBRARY_PATH. Is there any way around that?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page