# FreeFEM compilation error : \_\_float128 problem

**URL:** <https://community.freefem.org/t/freefem-compilation-error-float128-problem/2083>\
**Category:** General Discussion\
**Created:** [October 24, 2022, 1:35pm UTC](https://community.freefem.org/t/freefem-compilation-error-float128-problem/2083 "2022-10-24T13:35:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffeppon](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/ffeppon/32/1011_2.png) [@ffeppon](https://community.freefem.org/u/ffeppon)\
**Post date:** [October 24, 2022, 1:35pm UTC](https://community.freefem.org/t/freefem-compilation-error-float128-problem/2083/1 "2022-10-24T13:35:30Z")

</div>

Dear developpers,

I am encountering some difficulties to compile FreeFEM on a compute server.  
When I reach the compulation of mpi plugins, I have the error below…  
I have also seen error messages stating

```auto
error: cannot convert ‘std::complex<double>’ to ‘ __complex__ __float128’ in assignment

```

I think the compute server runs on ubuntu (I don’t have root access) and I am compiling with gcc version 7.5.

Many thanks in advance for your help.  
Florian

```auto
./ff-petsc/r/bin/mpicxx -c -fPIC -std=gnu++17 -std=c++14 -std=c++14 '-I../seq/include' '-DWITH_slepc' '-I./ff-petsc/r/include' '-DWITH_petsc' '-I./ff-petsc/r/include' '-DWITH_blas' '-I./ff-petsc/r/include' '-I./ff-petsc/r/include' -fcommon -pthread -DNDEBUG -O3 -mmmx -mavx -std=c++14 -DBAMG_LONG_LONG -DNCHECKPTR -fPIC -I./ff-petsc/r/include 'PETSc.cpp'
In file included from PETSc.cpp:4:0:
PETSc-code.hpp:3008:13: warning: MATTRANSPOSEMAT macro is deprecated use MATTRANSPOSEVIRTUAL (since version 3.18)
           PetscStrcmp(type, MATTRANSPOSEMAT, &isType);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                        
PETSc-code.hpp:4475:13: warning: MATTRANSPOSEMAT macro is deprecated use MATTRANSPOSEVIRTUAL (since version 3.18)
                           PetscStrcmp(type, MATTRANSPOSEMAT, &isType);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                        
PETSc-code.hpp:4482:13: warning: MATTRANSPOSEMAT macro is deprecated use MATTRANSPOSEVIRTUAL (since version 3.18)
                               type = MATTRANSPOSEMAT;
             ^ ~~~~~~~~~~~~~~~~~~~~~~~                                         
PETSc-code.hpp:4495:13: warning: MATTRANSPOSEMAT macro is deprecated use MATTRANSPOSEVIRTUAL (since version 3.18)
                           PetscStrcmp(type, MATTRANSPOSEMAT, &isType);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                        
PETSc-code.hpp: In member function ‘AnyType PETSc::setOptions<Type>::setOptions_Op::operator()(Stack) const’:
PETSc-code.hpp:2422:211: error: ‘class KNM< __float128>’ has no member named ‘operator double*’; did you mean ‘operator__ float128*’?
 rdinates(pc, coordinates->N( ), coordinates->M( ), reinterpret_cast<PetscReal*>(coordinates->operator double*()));
                                                                                                             ^
                                                                                                                                                                                                                   operator 121
PETSc-code.hpp: In function ‘KN_<double> PETSc::Dmat_D(Dmat*)’:
PETSc-code.hpp:4786:131: error: no matching function for call to ‘KN_<double>::KN_(HPDDM::upscaled_type<double>*, int)’
 reinterpret_cast<HPDDM::upscaled_type<PetscReal>*>(const_cast<PetscReal*>(p->_A->getScaling())), p->_A->getDof());
                                                                                                                 ^
In file included from ../seq/include/AFunction.hpp:54:0,
                 from ../seq/include/ff++.hpp:21,
                 from common_hpddm.hpp:6,
                 from PETSc.hpp:6,
                 from PETSc-code.hpp:3,
                 from PETSc.cpp:4:
../seq/include/RNM.hpp:609:3: note: candidate: KN_<R>::KN_(const KN_<R>&, long int, const ShapeOfArray&, long int) [with R = double]
   KN_(const KN_<R> & u,long nnext,const ShapeOfArray &sh,long startv=0)
   ^~~../seq/include/RNM.hpp:609:3: note: candidate expects 4 arguments, 2 provided
../seq/include/RNM.hpp:607:3: note: candidate: KN_<R>::KN_(const KN_<R>&, const ShapeOfArray&, long int) [with R = double]
   KN_(const KN_<R> & u,const ShapeOfArray &sh,long startv=0)
   ^~~../seq/include/RNM.hpp:607:3: note: no known conversion for argument 1 from ‘HPDDM::upscaled_type<double>* {aka __float128*}’ to ‘const KN_<double>&’
../seq/include/RNM.hpp:606:3: note: candidate: KN_<R>::KN_(const KN_<R>&, long int) [with R = double]
   KN_(const KN_<R> & u,long offset) :ShapeOfArray(u),v(&u[offset]){}
   ^~~../seq/include/RNM.hpp:606:3: note: no known conversion for argument 1 from ‘HPDDM::upscaled_type<double>* {aka __float128*}’ to ‘const KN_<double>&’
../seq/include/RNM.hpp:588:3: note: candidate: KN_<R>::KN_(R*, long int) [with R = double]
   KN_(R *u,long nn):ShapeOfArray(nn),v(u){}
   ^~~../seq/include/RNM.hpp:588:3: note: no known conversion for argument 1 from ‘HPDDM::upscaled_type<double>* {aka __float128*}’ to ‘double*’
../seq/include/RNM.hpp:587:3: note: candidate: KN_<R>::KN_(R*, long int, long int, long int) [with R = double]
   KN_(R *u,long nn,long s,long nextt):ShapeOfArray(nn,s,nextt),v(u){}
   ^~~../seq/include/RNM.hpp:587:3: note: candidate expects 4 arguments, 2 provided
../seq/include/RNM.hpp:586:3: note: candidate: KN_<R>::KN_(R*, long int, long int) [with R = double]
   KN_(R *u,long nn,long s):ShapeOfArray(nn,s),v(u){}
   ^~~../seq/include/RNM.hpp:586:3: note: candidate expects 3 arguments, 2 provided
../seq/include/RNM.hpp:585:3: note: candidate: KN_<R>::KN_(R*, const ShapeOfArray&) [with R = double]
   KN_(R *u,const ShapeOfArray & s):ShapeOfArray(s),v(u){}
   ^~~../seq/include/RNM.hpp:585:3: note: no known conversion for argument 1 from ‘HPDDM::upscaled_type<double>* {aka __float128*}’ to ‘double*’
../seq/include/RNM.hpp:409:3: note: candidate: KN_<R>::KN_(const KN_<R>&, const SubArray&) [with R = double]
   KN_(const KN_<R> & U,const SubArray & sa) : ShapeOfArray(U,sa),v(U.v + U.index(sa.start)) {}
   ^~~../seq/include/RNM.hpp:409:3: note: no known conversion for argument 1 from ‘HPDDM::upscaled_type<double>* {aka __float128*}’ to ‘const KN_<double>&’
../seq/include/RNM.hpp:408:3: note: candidate: KN_<R>::KN_(const KN_<R>&) [with R = double]
   KN_(const KN_<R> & u) :ShapeOfArray(u),v(u.v){}
   ^~~../seq/include/RNM.hpp:408:3: note: candidate expects 1 argument, 2 provided
In file included from common_hpddm.hpp:510:0,
                 from PETSc.hpp:6,
                 from PETSc-code.hpp:3,
                 from PETSc.cpp:4:
../seq/iovtk.cpp: In function ‘Fem2D::Mesh* VTK_Load(const string&, bool, KN<KN<double> >*)’:
../seq/iovtk.cpp:1421:9: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   fscanf(fp, "%s", buffer); // ASCII or BINARY
   ~~~~~~^~~~~~~~~~~~~~~~~~../seq/iovtk.cpp: In function ‘Fem2D::Mesh3* VTK_Load3(const string&, bool, bool, bool, double, KN<KN<double> >*)’:
../seq/iovtk.cpp:3195:9: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   fscanf(fp, "%s", buffer); // ASCII or BINARY
   ~~~~~~^~~~~~~~~~~~~~~~~~
Makefile:657: recipe for target 'PETSc.so' failed
make[3]: *** [PETSc.so] Error 1
make[3]: Leaving directory '.-recipes/FreeFem-sources/plugin/mpi'
Makefile:664: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '.-recipes/FreeFem-sources/plugin'
Makefile:800: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '.-recipes/FreeFem-sources'
Makefile:750: recipe for target 'all' failed
make: *** [all] Error 2

```

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [October 24, 2022, 1:58pm UTC](https://community.freefem.org/t/freefem-compilation-error-float128-problem/2083/2 "2022-10-24T13:58:12Z")

</div>

Which PETSc version are you using?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [October 24, 2022, 2:01pm UTC](https://community.freefem.org/t/freefem-compilation-error-float128-problem/2083/3 "2022-10-24T14:01:12Z")

</div>

Consider switching to FreeFEM `develop` branch and starting from scratch (including `make petsc-slepc`).

---

<div class="post-metadata">

**Author:** ![ffeppon](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/ffeppon/32/1011_2.png) [@ffeppon](https://community.freefem.org/u/ffeppon)\
**Post date:** [October 25, 2022, 9:53am UTC](https://community.freefem.org/t/freefem-compilation-error-float128-problem/2083/4 "2022-10-25T09:53:57Z")

</div>

Hi,

Ok compiling the develop branch worked. I used the last version of PETSC which I compile separately in order to also have mpich and other libraries.

Thanks !  
Florian
