[petsc-dev] source code and configure don't know what each other is doing?

Barry Smith bsmith at mcs.anl.gov
Mon Nov 18 06:58:31 CST 2013


  I think you missed my point. The source code uses _Complex but the configure test uses complex (nothing to do with complex.h). Shouldn’t the configure test use _Complex?


http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2013/11/17/build_master_arch-linux-c89_thrash.log

         CC arch-linux-c89/obj/src/sys/objects/pinit.o
In file included from /sandbox/petsc/petsc.clone-2/include/petscsys.h:326:0,
                 from /sandbox/petsc/petsc.clone-2/include/petsc-private/petscimpl.h:8,
                 from src/sys/objects/pinit.c:6:
/sandbox/petsc/petsc.clone-2/include/petscmath.h:119:16: warning: ISO C90 does not support complex types [-Wpedantic]
 typedef double _Complex PetscComplex;

but 

================================================================================
TEST checkC99Complex from config.types(/sandbox/petsc/petsc.clone-2/config/BuildSystem/config/types.py:106)
TESTING: checkC99Complex from config.types(/sandbox/petsc/petsc.clone-2/config/BuildSystem/config/types.py:106)
  Check for complex numbers in in C99 std
Executing: mpicc -c -o /tmp/petsc-j_TCTN/config.types/conftest.o -I/tmp/petsc-j_TCTN/config.libraries -I/tmp/petsc-j_TCTN/config.setCompilers -I/tmp/petsc-j_TCTN/config.compilers -I/tmp/petsc-j_TCTN/config.headers -I/tmp/petsc-j_TCTN/PETSc.utilities.cacheDetails -I/tmp/petsc-j_TCTN/config.functions -I/tmp/petsc-j_TCTN/config.types -std=c89 -pedantic -Wno-long-long -fPIC -g3 -fno-inline -O0  /tmp/petsc-j_TCTN/config.types/conftest.c 
Successful compile:
Source:
#include "confdefs.h"
#include "conffix.h"
#include <complex.h>

int main() {
double complex x;
 x = I;
;
  return 0;
}
                Pushing language C
                Popping language C
Executing: mpicc  -o /tmp/petsc-j_TCTN/config.types/conftest   -std=c89 -pedantic -Wno-long-long -fPIC -g3 -fno-inline -O0 /tmp/petsc-j_TCTN/config.types/conftest.o -Wl,-rpath,/nfs/software/linux-ubuntu_precise_amd64/apps/packages/gcc-4.8.0/lib/gcc/x86_64-unknown-linux-gnu/4.8.0 -L/nfs/software/linux-ubuntu_precise_amd64/apps/packages/gcc-4.8.0/lib/gcc/x86_64-unknown-linux-gnu/4.8.0 -Wl,-rpath,/nfs/software/linux-ubuntu_precise_amd64/apps/packages/gcc-4.8.0/lib/gcc -L/nfs/software/linux-ubuntu_precise_amd64/apps/packages/gcc-4.8.0/lib/gcc -Wl,-rpath,/nfs/software/linux-ubuntu_precise_amd64/apps/packages/gcc-4.8.0/lib64 -L/nfs/software/linux-ubuntu_precise_amd64/apps/packages/gcc-4.8.0/lib64 -Wl,-rpath,/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/nfs/software/linux-ubuntu_precise_amd64/apps/packages/gcc-4.8.0/lib -L/nfs/software/linux-ubuntu_precise_amd64/apps/packages/gcc-4.8.0/lib -ldl -lmpich -lopa -lmpl -lrt -lcr -lpthread -lgcc_s -ldl 
        Defined "HAVE_C99_COMPLEX" to “1"

On Nov 18, 2013, at 1:33 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> Barry Smith <bsmith at mcs.anl.gov> writes:
> 
>>  configure looks for complex but source code uses _Complex. 
> 
> include/petscmath.h:/* Use C99 _Complex for the type. Do not include complex.h by default to define "complex" because of symbol conflicts in Hypre. */
> include/petscmath.h-/* Compilation units that can safely use complex should define PETSC_DESIRE_COMPLEX before including any headers */
> 
>>  Come guys this is just absurd.  How can we make sure our configure
>>  tests actually have something to do with the real usage?
> 
> Do you have a case where this does not work?  "_Complex" is the C99
> keyword, where as complex.h is the C99 complex header, which defines
> "complex" and related stuff.  complex.h conflicts with Hypre so we can't
> include it by default, thus the comment in the source.
> 
>> 
>> TEST checkC99Complex from config.types(/sandbox/petsc/petsc.clone-2/config/BuildSystem/config/types.py:106)
>> TESTING: checkC99Complex from config.types(/sandbox/petsc/petsc.clone-2/config/BuildSystem/config/types.py:106)
>>  Check for complex numbers in in C99 std
>> Executing: mpicc -c -o /tmp/petsc-t5CRsd/config.types/conftest.o -I/tmp/petsc-t5CRsd/config.libraries -I/tmp/petsc-t5CRsd/config.compilers -I/tmp/petsc-t5CRsd/config.setCompilers -I/tmp/petsc-t5CRsd/config.headers -I/tmp/petsc-t5CRsd/PETSc.utilities.cacheDetails -I/tmp/petsc-t5CRsd/config.functions -I/tmp/petsc-t5CRsd/config.types -std=c89 -pedantic -Wno-long-long -fPIC -g3 -O0  /tmp/petsc-t5CRsd/config.types/conftest.c 
>> Successful compile:
>> Source:
>> #include "confdefs.h"
>> #include "conffix.h"
>> #include <complex.h>
>> 
>> int main() {
>> double complex x;
>> x = I;
>> ;
>>  return 0;
>> }
>> 
>> #elif defined(PETSC_USE_REAL_DOUBLE)
>> typedef double _Complex PetscComplex;




More information about the petsc-dev mailing list