Skip to content

Commit

Permalink
Enhancements in CMake-build
Browse files Browse the repository at this point in the history
Changes to be committed:

modified:   CMakeLists.txt
new file:   LICENSE
modified:   LICENSE.gpl3.md
modified:   cmake/addARPACK.cmake
modified:   cmake/addFFTW.cmake
modified:   cmake/addGTKFortran.cmake
modified:   cmake/addGmsh.cmake
modified:   cmake/addLIS.cmake
modified:   cmake/addMetis.cmake
modified:   cmake/addOpenMP.cmake
modified:   cmake/addPLPLOT.cmake
modified:   cmake/install.cmake
new file:   cmake/packaging.cmake
modified:   cmake/prefixPaths.cmake
modified:   cmake/targetIncludeDirs.cmake
modified:   cmake/targetLinkLibs.cmake
modified:   cmake/targetProperties.cmake
  • Loading branch information
vickysharma0812 committed Jun 4, 2023
1 parent cf0c391 commit 07107a0
Show file tree
Hide file tree
Showing 17 changed files with 437 additions and 166 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ INCLUDE(${PROJECT_SOURCE_DIR}/cmake/targetCompileOpts.cmake)
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/targetCompileDefs.cmake)
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/targetProperties.cmake)
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/install.cmake)
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/packaging.cmake)
94 changes: 94 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
EASIFEM, Expandable And Scalable Infrastructure for Finite Element Methods,
is a framework for implementing finite element methods in Modern Fortran.
easifemBase is a part of EASIFEM library.
Copyright(C) 2020-2023
Vikas Sharma
Ph.D. (Kyoto University, Japan)
B. Tech. (IIT Bombay, India)
[email protected]
https://www.easifem.com

===========================================================================
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https: //www.gnu.org/licenses/>

===========================================================================

EASIFEM depends upon following fortran-libraries.
It is worth noting that some of these libraries have been
modified by EASIFEM depending upon necessary needs.

(1) PENF
PENF is developed by [Mr. Szaghi](https://github.com/szaghi).
This library tries to exploit code portability for modern (2003+) Fortran projects.
It is a pure Fortran library for achieving portable codes for modern Fortran projects.
It provides many number-to-string and vice-versa facilities.
[Read more](https://github.com/szaghi/PENF/tree/master/src)

(2) BeFoR64

This library is also a fortran project of [Mr. Szaghi](https://github.com/szaghi).
It is for *base64* encoding/decoding for modern Fortran projects.
[Read more](https://github.com/szaghi/BeFoR64)

(3) StringiFor

This library is also a fortran project of [Mr. Szaghi](https://github.com/szaghi).
This library makes an attempt to define string data type for handling characters in an object oriented way.
[Read more](https://github.com/szaghi/StringiFor)

(4)) FoXy

This is a fortran library which is designed to handle XML files.
[Read more](https://github.com/Fortran-FOSS-Programmers/FoXy)

(5) vtkFortran

This fortran library handles IO with vtk files.
[Read more](https://github.com/szaghi/VTKFortran)

(6) H5Fortran

This fortran project, which is developed by [Michael Hirsch](https://github.com/scivision), can handle IO with hdf5 files.
[Read more](https://github.com/geospace-code/h5fortran.git).

(7) OGPF
This is program creates an interface between modern fortran and gnuplot.
This is a useful library for visualising fortran data using gnuplot. [Read more](https://github.com/kookma/ogpf).
In easifem this is renamed as `Gnuplot_Method.F90`.

(8) Sparsekit

Sparsekit is a legacy fortran code written by the great [Yusef Saad](https://en.wikipedia.org/wiki/Yousef_Saad) for
peforming linear algebra with sparse matrices. [Read more](https://www-users.cs.umn.edu/~saad/software/SPARSKIT/).
Some of these programs have been rewritten from F77 to Modern fortran.

(9) M_SYSTEM

This is Fortran interface to C system interface. It is taken from <https://github.com/urbanjost/M_system>.
The original name of the program has been changed from M_SYSTEM to System_Method.
This is to confirm to the coding sytles of easifem.

(10) FACE

Fortran ANSI Color. Source: <https://github.com/szaghi/FACE>

(11) ExceptionHandlerType

This is libray can handle exceptions in fortran. Source: <https://github.com/CASL/Futility>.
This library is modified as per the needs.

(12) Fortran-TestAnything

It is a library for testing fortran program. Source : <https://github.com/dennisdjensen/fortran-testanything>.
The original name of the program is changed from Test.F90 to Test_Method.F90 to confirm the coding standards of easifem.
38 changes: 19 additions & 19 deletions LICENSE.gpl3.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The precise terms and conditions for copying, distribution and modification foll

## TERMS AND CONDITIONS

### 0. Definitions.
### 0. Definitions

&ldquo;This License&rdquo; refers to version 3 of the GNU General Public License.

Expand Down Expand Up @@ -103,7 +103,7 @@ licensees may convey the work under this License, and how to view a copy of this
License. If the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

### 1. Source Code.
### 1. Source Code

The &ldquo;source code&rdquo; for a work means the preferred form of the work for
making modifications to it. &ldquo;object code&rdquo; means any non-source form of a
Expand Down Expand Up @@ -140,7 +140,7 @@ automatically from other parts of the Corresponding Source.

The Corresponding Source for a work in source code form is that same work.

### 2. Basic Permissions.
### 2. Basic Permissions

All rights granted under this License are granted for the term of copyright on the
Program, and are irrevocable provided the stated conditions are met. This License
Expand All @@ -162,7 +162,7 @@ with you.
Conveying under any other circumstances is permitted solely under the conditions
stated below. Sublicensing is not allowed; section 10 makes it unnecessary.

### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law

No covered work shall be deemed part of an effective technological measure under any
applicable law fulfilling obligations under article 11 of the WIPO copyright treaty
Expand All @@ -176,7 +176,7 @@ intention to limit operation or modification of the work as a means of enforcing
against the work's users, your or third parties' legal rights to forbid circumvention
of technological measures.

### 4. Conveying Verbatim Copies.
### 4. Conveying Verbatim Copies

You may convey verbatim copies of the Program's source code as you receive it, in any
medium, provided that you conspicuously and appropriately publish on each copy an
Expand All @@ -188,7 +188,7 @@ this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer
support or warranty protection for a fee.

### 5. Conveying Modified Source Versions.
### 5. Conveying Modified Source Versions

You may convey a work based on the Program, or the modifications to produce it from
the Program, in the form of source code under the terms of section 4, provided that
Expand Down Expand Up @@ -217,7 +217,7 @@ copyright are not used to limit the access or legal rights of the compilation's
beyond what the individual works permit. Inclusion of a covered work in an aggregate
does not cause this License to apply to the other parts of the aggregate.

### 6. Conveying Non-Source Forms.
### 6. Conveying Non-Source Forms

You may convey a covered work in object code form under the terms of sections 4 and
5, provided that you also convey the machine-readable Corresponding Source under the
Expand Down Expand Up @@ -297,7 +297,7 @@ this section must be in a format that is publicly documented (and with an
implementation available to the public in source code form), and must require no
special password or key for unpacking, reading or copying.

### 7. Additional Terms.
### 7. Additional Terms

&ldquo;Additional permissions&rdquo; are terms that supplement the terms of this
License by making exceptions from one or more of its conditions. Additional
Expand Down Expand Up @@ -351,7 +351,7 @@ Additional terms, permissive or non-permissive, may be stated in the form of a
separately written license, or stated as exceptions; the above requirements apply
either way.

### 8. Termination.
### 8. Termination

You may not propagate or modify a covered work except as expressly provided under
this License. Any attempt otherwise to propagate or modify it is void, and will
Expand All @@ -375,7 +375,7 @@ parties who have received copies or rights from you under this License. If your
rights have been terminated and not permanently reinstated, you do not qualify to
receive new licenses for the same material under section 10.

### 9. Acceptance Not Required for Having Copies.
### 9. Acceptance Not Required for Having Copies

You are not required to accept this License in order to receive or run a copy of the
Program. Ancillary propagation of a covered work occurring solely as a consequence of
Expand All @@ -385,7 +385,7 @@ propagate or modify any covered work. These actions infringe copyright if you do
accept this License. Therefore, by modifying or propagating a covered work, you
indicate your acceptance of this License to do so.

### 10. Automatic Licensing of Downstream Recipients.
### 10. Automatic Licensing of Downstream Recipients

Each time you convey a covered work, the recipient automatically receives a license
from the original licensors, to run, modify and propagate that work, subject to this
Expand All @@ -408,7 +408,7 @@ initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleg
that any patent claim is infringed by making, using, selling, offering for sale, or
importing the Program or any portion of it.

### 11. Patents.
### 11. Patents

A &ldquo;contributor&rdquo; is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The work thus
Expand Down Expand Up @@ -469,7 +469,7 @@ Nothing in this License shall be construed as excluding or limiting any implied
license or other defenses to infringement that may otherwise be available to you
under applicable patent law.

### 12. No Surrender of Others' Freedom.
### 12. No Surrender of Others' Freedom

If conditions are imposed on you (whether by court order, agreement or otherwise)
that contradict the conditions of this License, they do not excuse you from the
Expand All @@ -480,7 +480,7 @@ agree to terms that obligate you to collect a royalty for further conveying from
those to whom you convey the Program, the only way you could satisfy both those terms
and this License would be to refrain entirely from conveying the Program.

### 13. Use with the GNU Affero General Public License.
### 13. Use with the GNU Affero General Public License

Notwithstanding any other provision of this License, you have permission to link or
combine any covered work with a work licensed under version 3 of the GNU Affero
Expand All @@ -489,7 +489,7 @@ The terms of this License will continue to apply to the part which is the covere
work, but the special requirements of the GNU Affero General Public License, section
13, concerning interaction through a network will apply to the combination as such.

### 14. Revised Versions of this License.
### 14. Revised Versions of this License

The Free Software Foundation may publish revised and/or new versions of the GNU
General Public License from time to time. Such new versions will be similar in spirit
Expand All @@ -511,7 +511,7 @@ Later license versions may give you additional or different permissions. However
additional obligations are imposed on any author or copyright holder as a result of
your choosing to follow a later version.

### 15. Disclaimer of Warranty.
### 15. Disclaimer of Warranty

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
Expand All @@ -521,7 +521,7 @@ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

### 16. Limitation of Liability.
### 16. Limitation of Liability

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
Expand All @@ -532,7 +532,7 @@ OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERA
WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

### 17. Interpretation of Sections 15 and 16.
### 17. Interpretation of Sections 15 and 16

If the disclaimer of warranty and limitation of liability provided above cannot be
given local legal effect according to their terms, reviewing courts shall apply local
Expand Down Expand Up @@ -593,4 +593,4 @@ proprietary programs. If your program is a subroutine library, you may consider
more useful to permit linking proprietary applications with the library. If this is
what you want to do, use the GNU Lesser General Public License instead of this
License. But first, please read
&lt;<http://www.gnu.org/philosophy/why-not-lgpl.html>&gt;.
&lt;<http://www.gnu.org/philosophy/why-not-lgpl.html>&gt;.
24 changes: 13 additions & 11 deletions cmake/addARPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
# along with this program. If not, see <https: //www.gnu.org/licenses/>
#

OPTION(USE_ARPACK OFF)
IF(USE_ARPACK)
FIND_PACKAGE(arpackng REQUIRED)
IF(arpackng_FOUND)
MESSAGE(STATUS "FOUND ARPACK-NG")
LIST( APPEND TARGET_COMPILE_DEF "-DUSE_ARPACK" )
LIST( APPEND TARGET_COMPILE_OPT ${arpackng_Fortran_FLAGS} )
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ARPACK::ARPACK)
ELSE()
MESSAGE(ERROR "NOT FOUND ARPACK-NG")
IF( ${PROJECT_NAME} MATCHES "easifemBase" )
OPTION(USE_ARPACK OFF)
IF(USE_ARPACK)
FIND_PACKAGE(arpackng REQUIRED)
IF(arpackng_FOUND)
MESSAGE(STATUS "FOUND ARPACK-NG")
LIST( APPEND TARGET_COMPILE_DEF "-DUSE_ARPACK" )
LIST( APPEND TARGET_COMPILE_OPT ${arpackng_Fortran_FLAGS} )
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ARPACK::ARPACK)
ELSE()
MESSAGE(ERROR "NOT FOUND ARPACK-NG")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
2 changes: 1 addition & 1 deletion cmake/addFFTW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ IF( ${PROJECT_NAME} MATCHES "easifemBase" )
ELSE()
MESSAGE( STATUS "NOT USING FFTW LIBRARIES" )
ENDIF()
ENDIF()
ENDIF()
2 changes: 1 addition & 1 deletion cmake/addGTKFortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ IF( ${PROJECT_NAME} MATCHES "easifemBase" )
ELSE()
MESSAGE( STATUS "NOT USING PLPLOT LIBRARIES" )
ENDIF()
ENDIF()
ENDIF()
2 changes: 1 addition & 1 deletion cmake/addGmsh.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ IF( ${PROJECT_NAME} MATCHES "easifemClasses" )
ELSE()
MESSAGE( STATUS "NOT USING GMSH SDK LIBRARIES" )
ENDIF()
ENDIF()
ENDIF()
32 changes: 19 additions & 13 deletions cmake/addLIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,25 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https: //www.gnu.org/licenses/>
#
# LIS
OPTION( USE_LIS OFF )
IF( USE_LIS )
LIST( APPEND TARGET_COMPILE_DEF "-DUSE_LIS" )
IF( UNIX )
IF(APPLE)
SET( LIS_LIBRARIES "$ENV{EASIFEM_EXTPKGS}/lib/liblis.dylib" )
ELSE()
SET( LIS_LIBRARIES "$ENV{EASIFEM_EXTPKGS}/lib/liblis.so" )

#....................................................................
#
#....................................................................

IF( ${PROJECT_NAME} MATCHES "easifemBase" )
OPTION( USE_LIS OFF )
IF( USE_LIS )
LIST( APPEND TARGET_COMPILE_DEF "-DUSE_LIS" )
IF( UNIX )
IF(APPLE)
SET( LIS_LIBRARIES "$ENV{EASIFEM_EXTPKGS}/lib/liblis.dylib" )
ELSE()
SET( LIS_LIBRARIES "$ENV{EASIFEM_EXTPKGS}/lib/liblis.so" )
ENDIF()
ENDIF()
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PUBLIC ${LIS_LIBRARIES} )
MESSAGE( STATUS "LIS_LIBRARIES : ${LIS_LIBRARIES}" )
ELSE()
MESSAGE( STATUS "NOT USING LIS LIBRARIES" )
ENDIF()
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PUBLIC ${LIS_LIBRARIES} )
MESSAGE( STATUS "LIS_LIBRARIES : ${LIS_LIBRARIES}" )
ELSE()
MESSAGE( STATUS "NOT USING LIS LIBRARIES" )
ENDIF()
2 changes: 1 addition & 1 deletion cmake/addMetis.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ IF( ${PROJECT_NAME} MATCHES "easifemBase" )
MESSAGE(STATUS "METIS_LIB = ${METIS_LIB}")
ENDIF()
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} PUBLIC ${METIS_LIB} )
ENDIF()
ENDIF()
26 changes: 14 additions & 12 deletions cmake/addOpenMP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@
# along with this program. If not, see <https: //www.gnu.org/licenses/>
#
# FIND OPENMP
OPTION(USE_OpenMP OFF)
IF(USE_OpenMP)
FIND_PACKAGE(OpenMP REQUIRED)
IF(OpenMP_FOUND)
MESSAGE(STATUS "FOUND OpenMP")
MESSAGE(STATUS "OpenMP_Fortran_LIBRARIES: ${OpenMP_Fortran_LIBRARIES}")
LIST( APPEND TARGET_COMPILE_DEF "-DUSE_OpenMP" )
LIST( APPEND TARGET_COMPILE_OPT ${OpenMP_Fortran_FLAGS} )
# TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${OpenMP_Fortran_LIBRARIES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_Fortran)
ELSE()
MESSAGE(ERROR "NOT FOUND OpenMP")
IF( ${PROJECT_NAME} MATCHES "easifemBase" )
OPTION(USE_OpenMP OFF)
IF(USE_OpenMP)
FIND_PACKAGE(OpenMP REQUIRED)
IF(OpenMP_FOUND)
MESSAGE(STATUS "FOUND OpenMP")
MESSAGE(STATUS "OpenMP_Fortran_LIBRARIES: ${OpenMP_Fortran_LIBRARIES}")
LIST( APPEND TARGET_COMPILE_DEF "-DUSE_OpenMP" )
LIST( APPEND TARGET_COMPILE_OPT ${OpenMP_Fortran_FLAGS} )
# TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${OpenMP_Fortran_LIBRARIES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_Fortran)
ELSE()
MESSAGE(ERROR "NOT FOUND OpenMP")
ENDIF()
ENDIF()
ENDIF()
Loading

0 comments on commit 07107a0

Please sign in to comment.