#342: Add CCTK_POINTER_SIZE make variable -------------------------+-------------------------------------------------- Reporter: hinder | Owner: Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: Keywords: flesh | -------------------------+-------------------------------------------------- It is sometimes necessary to know in a thorn's configuration script whether 32 bit or 64 bit code is to be generated. See the discussion in ticket #339.
The attached patch adds a CCTK_POINTER_SIZE make variable to make.config.defn which is accessible as a shell variable to configuration scripts. This will be 4 when compiling for 32 bit, and 8 when compiling for 64 bit.
I am not very expert in autoconf, so the patch might have to be modified. It seems to work, however.
I have not included the generated configure script - this should be generated by the person who commits the final patch.
#342: Add CCTK_POINTER_SIZE make variable --------------------------+------------------------------------------------- Reporter: hinder | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: Cactus | Version: Resolution: | Keywords: flesh --------------------------+------------------------------------------------- Changes (by hinder):
* status: new => review
#342: Add CCTK_POINTER_SIZE make variable --------------------------+------------------------------------------------- Reporter: hinder | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: Cactus | Version: Resolution: | Keywords: flesh --------------------------+-------------------------------------------------
Comment (by eschnett):
Cactus's autoconf already defines SIZEOF_CHAR_P, which is e.g. used to define the type CCTK_POINTER in Fortran. You can use this instead of defining a new constant.
#342: Add CCTK_POINTER_SIZE make variable --------------------------+------------------------------------------------- Reporter: hinder | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: Cactus | Version: Resolution: | Keywords: flesh --------------------------+-------------------------------------------------
Comment (by eschnett):
Can this ticket be closed?
#342: Add CCTK_POINTER_SIZE make variable --------------------------+------------------------------------------------- Reporter: hinder | Owner: Type: enhancement | Status: closed Priority: minor | Milestone: Component: Cactus | Version: Resolution: wontfix | Keywords: flesh --------------------------+------------------------------------------------- Changes (by hinder):
* status: review => closed * resolution: => wontfix
Comment:
Yes.
#342: Add CCTK_POINTER_SIZE make variable --------------------------+------------------------------------------------- Reporter: hinder | Owner: Type: enhancement | Status: closed Priority: minor | Milestone: Component: Cactus | Version: Resolution: wontfix | Keywords: flesh --------------------------+-------------------------------------------------
Comment (by hinder):
This patch arranges that a shell variable CCTK_POINTER_SIZE is accessible to configuration scripts. This is given its value from SIZEOF_CHAR_P. I don't know another way to get the value of SIZEOF_CHAR_P from a configuration script. If this patch is not the right way to do this, what do you suggest?
trac@lists.einsteintoolkit.org