From 19673c02048f128c5ff3ecd34e7b0f70ec529d18 Mon Sep 17 00:00:00 2001 From: Matthew Abruzzo Date: Sun, 28 Apr 2024 12:52:50 -0400 Subject: [PATCH 1/5] Dropped req for including headers in C++ apps Previously, C++ applications employing Grackle needed to manually declare that all functions in the grackle header files were written in the C programming language (Problems arise when this isn't done due to name-mangling and potential differences in calling conventions). This was commonly acheived by enclosing relevant include-directives in a C "language-linkage block," like the following ```c++ extern "C" { } ``` This commit makes a few standard modifications to the public header files to make this unnecessary (C++ applications can now directly use ``#include `` directives without any additional boiler-plate). We achieve this by modifying the public Grackle headers to conditionally include include these "language-linkage blocks" when it detects that a C++ compiler is being used - The usage of a C++ compiler is determined by checking for the existance of a macro, ``__cplusplus``, [that MUST be defined by a compliant C++ compiler](https://en.cppreference.com/w/cpp/preprocessor/replace#Predefined_macros) - Although the result is a little ugly, this an extremely common idiom that is present in lots of mainstream software (like [libpng](https://sourceforge.net/p/libpng/code/ci/libpng16/tree/png.h#l365) and hdf5) - This change won't cause any problems for existing applications that continue to explicitly enclose ``#include `` with a C "language-linkage block." This change is motivated by: 1. convenience 2. future-proofing. We eventually need to compile Grackle itself with a C++ compiler, (if we want to add GPU support). This change will be necessary to ensure that Grackle continues to compile the public API functions with "C-linkage" (to ensure API compatability with existing codes). - it's for this reason that I intentionally included this idiom in all public headers rather than just ``grackle.h`` (this will help us just in case new functions get introduced in other public headers before the transition to a C++ compiler and if Grackle's source directly include those headers) --- doc/source/Integration.rst | 12 +++++------- src/clib/grackle.h | 10 +++++++++- src/clib/grackle_chemistry_data.h | 10 +++++++++- src/clib/grackle_rate_functions.h | 10 +++++++++- src/clib/grackle_types.h | 10 +++++++++- src/example/cxx_example.C | 2 -- src/example/cxx_grid_example.C | 2 -- src/example/cxx_omp_example.C | 2 -- 8 files changed, 41 insertions(+), 17 deletions(-) diff --git a/doc/source/Integration.rst b/doc/source/Integration.rst index a04b7e85..3f13b6a8 100644 --- a/doc/source/Integration.rst +++ b/doc/source/Integration.rst @@ -73,15 +73,13 @@ Seven header files are installed with the grackle library. They are: * **grackle_macros.h** - contains some macros used internally. For C and C++ codes, the only source file that needs to be included in your -simulation code is **grackle.h**. For Fortran, use **grackle.def**. Since -Grackle is written in C, including **grackle.h** in a C++ code requires the -*extern "C"* directive. +simulation code is **grackle.h**. For Fortran, use **grackle.def**. -.. code-block:: c++ +.. note:: - extern "C" { - #include - } + Earlier versions of Grackle required C++ codes to enclose the ``#include `` include-directive within a C "language-linkage block" (the block starts with ``extern "C" {``). + C++ codes should now directly include the header **(without the block)**. + The headers internally use a standard idiom to properly handle this case. Data Types ---------- diff --git a/src/clib/grackle.h b/src/clib/grackle.h index 349e2e0a..c3141ee4 100644 --- a/src/clib/grackle.h +++ b/src/clib/grackle.h @@ -17,6 +17,10 @@ #include "grackle_types.h" #include "grackle_chemistry_data.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + extern int grackle_verbose; extern chemistry_data *grackle_data; @@ -117,4 +121,8 @@ int local_free_chemistry_data(chemistry_data *my_chemistry, chemistry_data_stora grackle_version get_grackle_version(void); -#endif +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* __GRACKLE_H__ */ diff --git a/src/clib/grackle_chemistry_data.h b/src/clib/grackle_chemistry_data.h index 55abc6a3..00e5d665 100644 --- a/src/clib/grackle_chemistry_data.h +++ b/src/clib/grackle_chemistry_data.h @@ -14,6 +14,10 @@ #ifndef __CHEMISTRY_DATA_H__ #define __CHEMISTRY_DATA_H__ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /********************************** *** Grackle runtime parameters *** **********************************/ @@ -448,4 +452,8 @@ typedef struct } photo_rate_storage; -#endif +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* __CHEMISTRY_DATA_H__ */ diff --git a/src/clib/grackle_rate_functions.h b/src/clib/grackle_rate_functions.h index 6b4bcc40..3d184656 100644 --- a/src/clib/grackle_rate_functions.h +++ b/src/clib/grackle_rate_functions.h @@ -4,6 +4,10 @@ #ifndef RATE_FUNCTIONS_H #define RATE_FUNCTIONS_H +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + double k1_rate(double T, double units, chemistry_data *my_chemistry); double k2_rate(double T, double units, chemistry_data *my_chemistry); double k3_rate(double T, double units, chemistry_data *my_chemistry); @@ -89,4 +93,8 @@ double comp_rate(double units, chemistry_data *my_chemistry); double gammah_rate(double units, chemistry_data *my_chemistry); double gamma_isrf_rate(double units, chemistry_data *my_chemistry); -#endif \ No newline at end of file +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* RATE_FUNCTIONS_H */ diff --git a/src/clib/grackle_types.h b/src/clib/grackle_types.h index 5eeadfb3..630a500a 100644 --- a/src/clib/grackle_types.h +++ b/src/clib/grackle_types.h @@ -21,6 +21,10 @@ #include "grackle_float.h" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + #ifdef GRACKLE_FLOAT_4 #define gr_float float #endif @@ -104,4 +108,8 @@ typedef struct } grackle_version; -#endif +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* __GRACKLE_TYPES_H__ */ diff --git a/src/example/cxx_example.C b/src/example/cxx_example.C index ccdbc44e..c91f4f20 100644 --- a/src/example/cxx_example.C +++ b/src/example/cxx_example.C @@ -17,9 +17,7 @@ #include #include -extern "C" { #include -} #define mh 1.67262171e-24 #define kboltz 1.3806504e-16 diff --git a/src/example/cxx_grid_example.C b/src/example/cxx_grid_example.C index fa0770d7..f2470319 100644 --- a/src/example/cxx_grid_example.C +++ b/src/example/cxx_grid_example.C @@ -22,9 +22,7 @@ #include #include -extern "C" { #include -} #define mh 1.67262171e-24 #define kboltz 1.3806504e-16 diff --git a/src/example/cxx_omp_example.C b/src/example/cxx_omp_example.C index 91e30737..4d321251 100644 --- a/src/example/cxx_omp_example.C +++ b/src/example/cxx_omp_example.C @@ -21,9 +21,7 @@ #include #endif -extern "C" { #include -} #define mh 1.67262171e-24 #define kboltz 1.3806504e-16 From fd595a87d0718c1c4c969324eda7a824fe47ea4a Mon Sep 17 00:00:00 2001 From: Matthew Abruzzo Date: Sat, 23 Mar 2024 16:00:02 -0400 Subject: [PATCH 2/5] Moved public headers into a separate directory. --- {src/clib => include}/grackle.def | 0 {src/clib => include}/grackle.h | 0 .../clib => include}/grackle_chemistry_data.h | 0 .../grackle_fortran_interface.def | 0 .../grackle_fortran_types.def | 0 {src/clib => include}/grackle_types.h | 0 src/clib/Make.config.assemble | 5 ++- src/clib/Makefile | 10 +++-- src/clib/README.md | 42 +++++++++++++++++++ src/python/setup.py | 2 +- .../tests/test_chemistry_struct_synched.py | 2 +- 11 files changed, 55 insertions(+), 6 deletions(-) rename {src/clib => include}/grackle.def (100%) rename {src/clib => include}/grackle.h (100%) rename {src/clib => include}/grackle_chemistry_data.h (100%) rename {src/clib => include}/grackle_fortran_interface.def (100%) rename {src/clib => include}/grackle_fortran_types.def (100%) rename {src/clib => include}/grackle_types.h (100%) create mode 100644 src/clib/README.md diff --git a/src/clib/grackle.def b/include/grackle.def similarity index 100% rename from src/clib/grackle.def rename to include/grackle.def diff --git a/src/clib/grackle.h b/include/grackle.h similarity index 100% rename from src/clib/grackle.h rename to include/grackle.h diff --git a/src/clib/grackle_chemistry_data.h b/include/grackle_chemistry_data.h similarity index 100% rename from src/clib/grackle_chemistry_data.h rename to include/grackle_chemistry_data.h diff --git a/src/clib/grackle_fortran_interface.def b/include/grackle_fortran_interface.def similarity index 100% rename from src/clib/grackle_fortran_interface.def rename to include/grackle_fortran_interface.def diff --git a/src/clib/grackle_fortran_types.def b/include/grackle_fortran_types.def similarity index 100% rename from src/clib/grackle_fortran_types.def rename to include/grackle_fortran_types.def diff --git a/src/clib/grackle_types.h b/include/grackle_types.h similarity index 100% rename from src/clib/grackle_types.h rename to include/grackle_types.h diff --git a/src/clib/Make.config.assemble b/src/clib/Make.config.assemble index 184ec5bc..1d7ba465 100644 --- a/src/clib/Make.config.assemble +++ b/src/clib/Make.config.assemble @@ -195,8 +195,11 @@ DEFINES = $(MACH_DEFINES) \ $(ASSEMBLE_IO_DEFINES) + BUILD_INCLUDES = -I$(GRACKLE_DIR)/../../include -I$(GRACKLE_DIR) + INCLUDES = $(MACH_INCLUDES) \ - $(MAKEFILE_INCLUDES) -I. + $(MAKEFILE_INCLUDES) \ + $(BUILD_INCLUDES) OBJS_LIB = $(OBJS_CONFIG_LIB) diff --git a/src/clib/Makefile b/src/clib/Makefile index 79838b44..e60a0cb0 100644 --- a/src/clib/Makefile +++ b/src/clib/Makefile @@ -148,7 +148,7 @@ verbose: VERBOSE = 1 @rm -f $@ @(if [ $(VERBOSE) -eq 0 ]; then \ echo "Compiling $<" ; \ - $(LIBTOOL) --mode=compile --tag=FC $(FC) -c $(FFLAGS) $(DEFINES) $*.F >& $(OUTPUT) ; \ + $(LIBTOOL) --mode=compile --tag=FC $(FC) -c $(FFLAGS) $(DEFINES) $(BUILD_INCLUDES) $*.F >& $(OUTPUT) ; \ if [ ! -e $@ ]; then \ echo; \ echo "Compiling $< failed!"; \ @@ -157,7 +157,7 @@ verbose: VERBOSE = 1 exit 1; \ fi ; \ else \ - $(LIBTOOL) --mode=compile --tag=FC $(FC) -c $(FFLAGS) $(DEFINES) $*.F; \ + $(LIBTOOL) --mode=compile --tag=FC $(FC) -c $(FFLAGS) $(DEFINES) $(BUILD_INCLUDES) $*.F; \ if [ ! -e $@ ]; then \ exit 1; \ fi ; \ @@ -277,12 +277,16 @@ help: # INSTALLATION TARGET #----------------------------------------------------------------------- +# we make a point to try to clean up any previously installed headers (this is +# mostly done to avoid confusions if/when we change the name of or delete a +# public header file install: @echo "Installing grackle header files to $(INSTALL_INCLUDE_DIR)." @(if [ ! -d $(INSTALL_INCLUDE_DIR) ]; then \ mkdir $(INSTALL_INCLUDE_DIR); \ fi) - @cp grackle.h grackle_macros.h grackle_float.h grackle_types.h grackle_chemistry_data.h grackle_rate_functions.h grackle.def grackle_fortran_types.def grackle_fortran_interface.def $(INSTALL_INCLUDE_DIR) + @rm -f $(INSTALL_INCLUDE_DIR)/grackle*.h $(INSTALL_INCLUDE_DIR)/grackle*.def + @cp ../../include/*.h ../../include/*.def grackle_float.h $(INSTALL_INCLUDE_DIR) @(if [ ! -d $(INSTALL_LIB_DIR) ]; then \ mkdir $(INSTALL_LIB_DIR); \ fi) diff --git a/src/clib/README.md b/src/clib/README.md new file mode 100644 index 00000000..35a3438f --- /dev/null +++ b/src/clib/README.md @@ -0,0 +1,42 @@ +# Basic Code Organization + +This directory contains all of Grackle's C and Fortran source code files. It also contains all private header files. + +The directory located at `../../include` (i.e. the `include` directory at the root of this repository) contains Grackle's public header files. + +We review the differences between these headers further down this page. + +# Include-Directive Conventions + + + +When including a public header file inside one of the source files contained by this directory, please directly specify the name of the header file and **NOT** a relative path. + +Suppose we had a file called ``./my_source.c``. To include the ``grackle.h`` file: +- you should write ``include "grackle.h"`` +- you should NOT write ``include "../../include/grackle.h"`` + +(we use the `-I` flag to tell the compiler where to search for the public headers) + +# More info and some conventions + +**What is the difference between public and private headers?** + +For the uninitiated: + +- public header files get installed with Grackle. + - These are the header files that are made available to downstream applications. + - Declarations for all of the functions and types that are part of our public API [described here](https://grackle.readthedocs.io/en/latest/Reference.html) must be stored in the so that files. + +- private header files are only used internal during the compilation process of Grackle. They include functions and types that are only used inside of Grackle. You should think of these as functions as private implementation details. + +*NOTE: just because a function/type is in the public header does not mean it is a part of the public API (the functions/types that are part of the public API are explicitly listed in the documentation at the above link). For example, we reserve the write to alter the contents of the * `chemistry_data_storage` * struct and it's contained structs*. + +Going forward, new private functions or types should generally be declared in the private headers. + +**How do we name files?** +In general, all public header files should probably include ``grackle`` at the start of their names (to avoid name-conflicts during installation). There's no need for a private header file to do this (in fact, it's probably preferable if they don't do this to make it easier to distinguish whether its public or private. A public header must **NOT** share a name with a private header. diff --git a/src/python/setup.py b/src/python/setup.py index 3750ae52..8ea04135 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -7,7 +7,7 @@ Extension( "pygrackle.grackle_wrapper", ["pygrackle/grackle_wrapper.pyx"], - include_dirs=["../clib"], + include_dirs=["../clib", "../../include"], library_dirs=["../clib/.libs/"], libraries=["grackle"], define_macros=[ diff --git a/src/python/tests/test_chemistry_struct_synched.py b/src/python/tests/test_chemistry_struct_synched.py index 4a91a75c..cc616d81 100644 --- a/src/python/tests/test_chemistry_struct_synched.py +++ b/src/python/tests/test_chemistry_struct_synched.py @@ -187,7 +187,7 @@ def test_grackle_chemistry_field_synched(): member_list = query_struct_fields( struct_name = "chemistry_data", path = os.path.join(os.path.dirname(os.path.abspath(__file__)), - "../../clib/grackle_chemistry_data.h") + "../../../include/grackle_chemistry_data.h") ) # now, categorize the fields by their datatype From 83830ea2c74bc038da0d442f6eabb3ca18a962bc Mon Sep 17 00:00:00 2001 From: Matthew Abruzzo Date: Wed, 27 Mar 2024 09:00:04 -0400 Subject: [PATCH 3/5] moved grackle_rate_functions.h into public header directory. --- {src/clib => include}/grackle_rate_functions.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {src/clib => include}/grackle_rate_functions.h (100%) diff --git a/src/clib/grackle_rate_functions.h b/include/grackle_rate_functions.h similarity index 100% rename from src/clib/grackle_rate_functions.h rename to include/grackle_rate_functions.h From 79b9694cf6acfd646a7cf4683caf65031493ac5b Mon Sep 17 00:00:00 2001 From: Matthew Abruzzo Date: Sat, 6 Apr 2024 16:16:24 -0400 Subject: [PATCH 4/5] moving public headers to src/include --- src/clib/Make.config.assemble | 2 +- src/clib/Makefile | 2 +- src/clib/README.md | 4 ++-- {include => src/include}/grackle.def | 0 {include => src/include}/grackle.h | 0 {include => src/include}/grackle_chemistry_data.h | 0 {include => src/include}/grackle_fortran_interface.def | 0 {include => src/include}/grackle_fortran_types.def | 0 {include => src/include}/grackle_rate_functions.h | 0 {include => src/include}/grackle_types.h | 0 src/python/setup.py | 2 +- src/python/tests/test_chemistry_struct_synched.py | 2 +- 12 files changed, 6 insertions(+), 6 deletions(-) rename {include => src/include}/grackle.def (100%) rename {include => src/include}/grackle.h (100%) rename {include => src/include}/grackle_chemistry_data.h (100%) rename {include => src/include}/grackle_fortran_interface.def (100%) rename {include => src/include}/grackle_fortran_types.def (100%) rename {include => src/include}/grackle_rate_functions.h (100%) rename {include => src/include}/grackle_types.h (100%) diff --git a/src/clib/Make.config.assemble b/src/clib/Make.config.assemble index 1d7ba465..6ee4287e 100644 --- a/src/clib/Make.config.assemble +++ b/src/clib/Make.config.assemble @@ -195,7 +195,7 @@ DEFINES = $(MACH_DEFINES) \ $(ASSEMBLE_IO_DEFINES) - BUILD_INCLUDES = -I$(GRACKLE_DIR)/../../include -I$(GRACKLE_DIR) + BUILD_INCLUDES = -I$(GRACKLE_DIR)/../include -I$(GRACKLE_DIR) INCLUDES = $(MACH_INCLUDES) \ $(MAKEFILE_INCLUDES) \ diff --git a/src/clib/Makefile b/src/clib/Makefile index e60a0cb0..56105e3f 100644 --- a/src/clib/Makefile +++ b/src/clib/Makefile @@ -286,7 +286,7 @@ install: mkdir $(INSTALL_INCLUDE_DIR); \ fi) @rm -f $(INSTALL_INCLUDE_DIR)/grackle*.h $(INSTALL_INCLUDE_DIR)/grackle*.def - @cp ../../include/*.h ../../include/*.def grackle_float.h $(INSTALL_INCLUDE_DIR) + @cp ../include/*.h ../include/*.def grackle_float.h $(INSTALL_INCLUDE_DIR) @(if [ ! -d $(INSTALL_LIB_DIR) ]; then \ mkdir $(INSTALL_LIB_DIR); \ fi) diff --git a/src/clib/README.md b/src/clib/README.md index 35a3438f..eeede150 100644 --- a/src/clib/README.md +++ b/src/clib/README.md @@ -2,7 +2,7 @@ This directory contains all of Grackle's C and Fortran source code files. It also contains all private header files. -The directory located at `../../include` (i.e. the `include` directory at the root of this repository) contains Grackle's public header files. +The directory located at `../include` (i.e. the `include` directory at `src/include`) contains Grackle's public header files. We review the differences between these headers further down this page. @@ -18,7 +18,7 @@ When including a public header file inside one of the source files contained by Suppose we had a file called ``./my_source.c``. To include the ``grackle.h`` file: - you should write ``include "grackle.h"`` -- you should NOT write ``include "../../include/grackle.h"`` +- you should NOT write ``include "../include/grackle.h"`` (we use the `-I` flag to tell the compiler where to search for the public headers) diff --git a/include/grackle.def b/src/include/grackle.def similarity index 100% rename from include/grackle.def rename to src/include/grackle.def diff --git a/include/grackle.h b/src/include/grackle.h similarity index 100% rename from include/grackle.h rename to src/include/grackle.h diff --git a/include/grackle_chemistry_data.h b/src/include/grackle_chemistry_data.h similarity index 100% rename from include/grackle_chemistry_data.h rename to src/include/grackle_chemistry_data.h diff --git a/include/grackle_fortran_interface.def b/src/include/grackle_fortran_interface.def similarity index 100% rename from include/grackle_fortran_interface.def rename to src/include/grackle_fortran_interface.def diff --git a/include/grackle_fortran_types.def b/src/include/grackle_fortran_types.def similarity index 100% rename from include/grackle_fortran_types.def rename to src/include/grackle_fortran_types.def diff --git a/include/grackle_rate_functions.h b/src/include/grackle_rate_functions.h similarity index 100% rename from include/grackle_rate_functions.h rename to src/include/grackle_rate_functions.h diff --git a/include/grackle_types.h b/src/include/grackle_types.h similarity index 100% rename from include/grackle_types.h rename to src/include/grackle_types.h diff --git a/src/python/setup.py b/src/python/setup.py index 8ea04135..45352e62 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -7,7 +7,7 @@ Extension( "pygrackle.grackle_wrapper", ["pygrackle/grackle_wrapper.pyx"], - include_dirs=["../clib", "../../include"], + include_dirs=["../clib", "../include"], library_dirs=["../clib/.libs/"], libraries=["grackle"], define_macros=[ diff --git a/src/python/tests/test_chemistry_struct_synched.py b/src/python/tests/test_chemistry_struct_synched.py index cc616d81..81c34bdc 100644 --- a/src/python/tests/test_chemistry_struct_synched.py +++ b/src/python/tests/test_chemistry_struct_synched.py @@ -187,7 +187,7 @@ def test_grackle_chemistry_field_synched(): member_list = query_struct_fields( struct_name = "chemistry_data", path = os.path.join(os.path.dirname(os.path.abspath(__file__)), - "../../../include/grackle_chemistry_data.h") + "../../include/grackle_chemistry_data.h") ) # now, categorize the fields by their datatype From 8016830c4610f3ae49ab1d5d436e6c8fa70b3bde Mon Sep 17 00:00:00 2001 From: Matthew Abruzzo Date: Tue, 28 May 2024 09:46:02 -0400 Subject: [PATCH 5/5] moved grackle_float.h.in into public header directory. --- src/clib/Make.config.assemble | 4 +++- src/clib/Makefile | 10 +++++----- src/{clib => include}/grackle_float.h.in | 0 3 files changed, 8 insertions(+), 6 deletions(-) rename src/{clib => include}/grackle_float.h.in (100%) diff --git a/src/clib/Make.config.assemble b/src/clib/Make.config.assemble index 6ee4287e..fc2c7604 100644 --- a/src/clib/Make.config.assemble +++ b/src/clib/Make.config.assemble @@ -195,7 +195,9 @@ DEFINES = $(MACH_DEFINES) \ $(ASSEMBLE_IO_DEFINES) - BUILD_INCLUDES = -I$(GRACKLE_DIR)/../include -I$(GRACKLE_DIR) + PUBLIC_HEADER_SRCDIR = $(GRACKLE_DIR)/../include + + BUILD_INCLUDES = -I$(PUBLIC_HEADER_SRCDIR) -I$(GRACKLE_DIR) INCLUDES = $(MACH_INCLUDES) \ $(MAKEFILE_INCLUDES) \ diff --git a/src/clib/Makefile b/src/clib/Makefile index 56105e3f..26b42b7e 100644 --- a/src/clib/Makefile +++ b/src/clib/Makefile @@ -214,10 +214,10 @@ autogen: config_type auto_general.c # in following recipe, GRACKLE_FLOAT_MACRO is set to either GRACKLE_FLOAT_4 or # GRACKLE_FLOAT_8 .PHONY: config_type -config_type: grackle_float.h.in +config_type: $(PUBLIC_HEADER_SRCDIR)/grackle_float.h.in @($(CONFIG_DIR)/configure_file.py --clobber \ - --input grackle_float.h.in \ - --output grackle_float.h \ + --input $< \ + --output $(PUBLIC_HEADER_SRCDIR)/grackle_float.h \ GRACKLE_FLOAT_MACRO=GRACKLE_FLOAT_$(ASSEMBLE_PRECISION_NUMBER)); # Force update of auto_general.c @@ -286,7 +286,7 @@ install: mkdir $(INSTALL_INCLUDE_DIR); \ fi) @rm -f $(INSTALL_INCLUDE_DIR)/grackle*.h $(INSTALL_INCLUDE_DIR)/grackle*.def - @cp ../include/*.h ../include/*.def grackle_float.h $(INSTALL_INCLUDE_DIR) + @cp ../include/*.h ../include/*.def $(INSTALL_INCLUDE_DIR) @(if [ ! -d $(INSTALL_LIB_DIR) ]; then \ mkdir $(INSTALL_LIB_DIR); \ fi) @@ -296,7 +296,7 @@ install: #----------------------------------------------------------------------- clean: - -@rm -f *.la .libs/* *.o *.lo DEPEND.bak *~ $(OUTPUT) grackle_float.h *.exe auto_*.c temp.show-* DEPEND out.make.DEPEND + -@rm -f *.la .libs/* *.o *.lo DEPEND.bak *~ $(OUTPUT) $(PUBLIC_HEADER_SRCDIR)/grackle_float.h *.exe auto_*.c temp.show-* DEPEND out.make.DEPEND -@touch DEPEND #----------------------------------------------------------------------- diff --git a/src/clib/grackle_float.h.in b/src/include/grackle_float.h.in similarity index 100% rename from src/clib/grackle_float.h.in rename to src/include/grackle_float.h.in