libMesh / libmesh

libMesh github repository
http://libmesh.github.io
GNU Lesser General Public License v2.1
642 stars 285 forks source link

memio.c:153:7: error: unknown type name 'SYSTEM_INFO' #2890

Open diogocecilio opened 3 years ago

diogocecilio commented 3 years ago

Dear all,

I'm building Libmesh in Windows 10 and when I type make I get the following error:

memio.c:153:7: error: unknown type name 'SYSTEM_INFO'

How to fix this?

jwpeterson commented 3 years ago

Hi,

memio.c is a netcdf file, so I don't know too much about it. We currently bundle NetCDF 4.6.2 with libmesh, so it's possible this incompatibility is fixed in later versions... unfortunately I don't have the time or operating system available to check this easily. Alternatively, you could try building libmesh with --disable-netcdf, although this will prevent you from writing output files in the Exodus format, which is one of the more popular ones used in libmesh.

roystgnr commented 3 years ago

It looks like SYSTEM_INFO is a Win32 API struct, defined in sysinfoapi.h? You might try adding an include for that to memio.c. But if you're hitting this problem at all then there's got to be something significantly different between your system and the systems the NetCDF Windows developers were using, and I'm not sure what other problems you're going to hit for the same reason.

What compiler are you using? If you're hitting a _WIN32 or _WIN64 code path then I'm guessing you're trying to build a native Windows app rather than a WSL app? If that's the case then you might hit problems in our code too, later in the build; I don't think we've ever supported native Windows builds without at least Cygwin or some sort of POSIX compatibility layer.

diogocecilio commented 3 years ago

Hi,

Thank you for your reply. Including sysinfoapi.h in memio.c doesn't work. I'm using the g++ -std=c++14 compiler.
I'm using M2sys64.

Here is the libmesh configuration sumary that i get:

----------------------------------- SUMMARY -----------------------------------

Package version............... : metaphysicl-1.1.0

C++ compiler.................. : g++ -std=c++14 C++ compiler flags............ : -g -O2 -Wall Install dir................... : /path/to/libmesh/install Build user.................... : diogo Build host.................... : DESKTOP-ORCL1G0 Configure date................ : 2021-03-29 15:43 Build architecture............ : x86_64-w64-mingw32 Git revision number........... : external

Optional Packages for Testing: MASA........................ : no VEXCL....................... : no TIMPI....................... : no


NetCDF C Configuration Summary

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

General


NetCDF Version: 4.6.2 Configured On: Mon Mar 29 15:38:56 -03 2021 Host System: x86_64-w64-mingw32 Build Directory: /d/libmesh3/libmesh-1.6.1/build/contrib/netcdf/v4 Install Prefix: /path/to/libmesh/install

Compiling Options


C Compiler: /mingw64/bin/gcc CFLAGS: CPPFLAGS: LDFLAGS: AM_CFLAGS: AM_CPPFLAGS: AM_LDFLAGS: Shared Library: yes Static Library: yes Extra libraries: -lm

Features


NetCDF-2 API: yes HDF4 Support: no NetCDF-4 API: no NC-4 Parallel Support: no PnetCDF Support: no DAP2 Support: no DAP4 Support: no Diskless Support: yes MMap Support: no JNA Support: no CDF5 Support: yes ERANGE Fill Support: no Relaxed Boundary Check: yes

----------------------------------- SUMMARY -----------------------------------

Package version............... : timpi-1.2.1

C++ compiler.................. : g++ Build Methods...................... : dbg devel opt CPPFLAGS...(dbg)................... : -DDEBUG CXXFLAGS...(dbg)................... : -O0 -felide-constructors -g -pedantic -W -Wall -Wextra -Wno-long-long -Wunused -Wpointer-arith -Wformat -Wparentheses -Woverloaded-virtual

CPPFLAGS...(devel)................. : CXXFLAGS...(devel)................. : -O2 -felide-constructors -g -pedantic -W -Wall -Wextra -Wno-long-long -Wunused -Wpointer-arith -Wformat -Wparentheses -Wuninitialized -funroll-loops -fstrict-aliasing -Woverloaded-virtual -Wdisabled-optimization

CPPFLAGS...(opt)................... : -DNDEBUG CXXFLAGS...(opt)................... : -O2 -felide-constructors -funroll-loops -fstrict-aliasing -Wdisabled-optimization

Install dir................... : /path/to/libmesh/install Build user.................... : diogo Build host.................... : DESKTOP-ORCL1G0 Configure date................ : 2021-03-29 15:43 Build architecture............ : x86_64-w64-mingw32 Git revision number........... : external


Optional Packages for Testing: MPI......................... : no

Configure complete, now type \'make\' and then \'make install\'.

----------------------------------- SUMMARY -----------------------------------

Package version.................... : libmesh-1.6.1

C++ compiler type.................. : gcc-other C++ compiler....................... : g++ C compiler......................... : gcc Fortran compiler................... : no Build Methods...................... : dbg devel opt

CPPFLAGS...(dbg)................... : -DDEBUG CXXFLAGS...(dbg)................... : -O0 -felide-constructors -g -pedantic -W -Wall -Wextra -Wno-long-long -Wunused -Wpointer-arith -Wformat -Wparentheses -Woverloaded-virtual -fopenmp CFLAGS.....(dbg)................... : -g -Wimplicit -fopenmp

CPPFLAGS...(devel)................. : CXXFLAGS...(devel)................. : -O2 -felide-constructors -g -pedantic -W -Wall -Wextra -Wno-long-long -Wunused -Wpointer-arith -Wformat -Wparentheses -Wuninitialized -funroll-loops -fstrict-aliasing -Woverloaded-virtual -Wdisabled-optimization -fopenmp CFLAGS.....(devel)................. : -O2 -funroll-loops -fstrict-aliasing -g -Wimplicit -funroll-loops -fstrict-aliasing -fopenmp

CPPFLAGS...(opt)................... : -DNDEBUG CXXFLAGS...(opt)................... : -O2 -felide-constructors -funroll-loops -fstrict-aliasing -Wdisabled-optimization -fopenmp CFLAGS.....(opt)................... : -O2 -funroll-loops -fstrict-aliasing -fopenmp

Any warnings-to-errors flags....... : Any extra paranoid warning flags... : Install dir........................ : /path/to/libmesh/install Build user......................... : diogo Build host......................... : DESKTOP-ORCL1G0 Build architecture................. : x86_64-w64-mingw32 Git revision....................... : HEAD

Library Features: library warnings................. : yes library deprecated code support.. : yes adaptive mesh refinement......... : yes blocked matrix/vector storage.... : no complex variables................ : no example suite.................... : yes ghosted vectors.................. : yes high-order shape functions....... : yes unique-id support................ : no id size (boundaries)............. : 2 bytes id size (dofs)................... : 4 bytes id size (processors)............. : 4 bytes id size (subdomains)............. : 2 bytes infinite elements................ : no Dirichlet constraints............ : yes node constraints................. : no parallel mesh.................... : no performance logging.............. : no periodic boundary conditions..... : yes reference counting............... : yes shape function 2nd derivatives... : yes stack trace files................ : no track node valence............... : yes variational smoother............. : yes xdr binary I/O................... : no

Optional Packages: boost............................ : yes capnproto........................ : no cppunit.......................... : no curl............................. : no eigen............................ : yes exodus........................... : yes version....................... : v5.22 fparser.......................... : yes build from version............ : release glpk............................. : no gmv.............................. : yes gzstream......................... : yes hdf5............................. : no laspack.......................... : no libhilbert....................... : yes metaphysicl...................... : yes metis............................ : yes mpi.............................. : no nanoflann........................ : yes nemesis.......................... : no netcdf........................... : yes version....................... : 4 nlopt............................ : no parmetis......................... : no petsc............................ : no qhull............................ : yes sfcurves......................... : no slepc............................ : no thread model..................... : pthread c++ rtti ........................ : yes tecio............................ : no tecplot...(vendor binaries)...... : no tetgen........................... : no triangle......................... : no trilinos......................... : no vtk.............................. : no

libmesh_optional_LIBS............ : -lz


Configure complete, now type 'make' and then 'make install'.


--------- Done Configuring libMesh ----------