I'm on a Fortran project, that I have to link 2 libraries who have same module name, under which, have same subroutine name. I'm using Intel Fortran compiler, when I import the module and call the subroutine, it always goes to the first one linked.
Is there a way that I can specifically call a subroutine from a specific library?
Here's some pseudo code:
Lib1 and Lib 2 both have this:
module foo
subroutine func()
write (*, *) "Hello from Lib1" ! or Lib2
end subroutine()
end module
Main
program Main
use foo, only: func
call func()
end program
CMakeLists.txt
target_link_libraries(Main PRIVATE libLib1.so libLib2.so)