Skip to content

Commit

Permalink
adding compiler option to enable/disable fortran wrapper, included ex…
Browse files Browse the repository at this point in the history
…ample in fortran
  • Loading branch information
scarrazza committed Aug 24, 2018
1 parent a71544c commit 990f40d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ install(FILES ${PROJECT_SOURCE_DIR}/src/qcdloop.pc DESTINATION lib/pkgconfig)
install(DIRECTORY src/qcdloop DESTINATION include)
install(TARGETS qcdloop DESTINATION lib)

# enable disable fortran/wrapper (to avoid name conflicts with ql1.x)
option(ENABLE_FORTRAN_WRAPPER "Enable fortran wrapper" ON)
if(ENABLE_FORTRAN_WRAPPER)
add_definitions(-DQL_NAMES)
endif()

# qcdloop examples
option(ENABLE_EXAMPLES "Compile test examples" OFF)
if(ENABLE_EXAMPLES)
Expand Down
19 changes: 19 additions & 0 deletions examples/fortran_test.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
! Example of fortran code calling the c++ library
! compile with: gfortran fortran_test.f `qcdloop-config --ldflags`

program main
implicit none
double complex qli1
double precision m, mu2

! init qcdloop objects
call qlinit()

m = 5d0
mu2 = 1.7d0**2
! call some test function
write(*,*) qli1(m, mu2, 0)
write(*,*) qli1(m, mu2, 1)
write(*,*) qli1(m, mu2, 2)

end

0 comments on commit 990f40d

Please sign in to comment.