# ifdef C Header file for multimachine

**URL:** https://discourse.cmake.org/t/ifdef-c-header-file-for-multimachine/6946
**Category:** Usage
**Tags:** os:windows
**Created:** [November 24, 2022, 5:30am UTC](https://discourse.cmake.org/t/ifdef-c-header-file-for-multimachine/6946 "2022-11-24T05:30:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![realbabilu](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/4af34b/32.png) [@realbabilu](https://discourse.cmake.org/u/realbabilu)
#### Post date: [November 24, 2022, 5:30am UTC](https://discourse.cmake.org/t/ifdef-c-header-file-for-multimachine/6946/1 "2022-11-24T05:30:37Z")

</div>

Hello  
i just new in cmake in windows. I use gcc/gfortran migw from equation and intel openapi fortran c compiler.

I will try to connect the superlu that have cmakefiles.txt and multi-machine ifdef in slu\_cnames.h header.  
C preprocessor definition CDEFS in the header file SRC/slu\_Cnames.h, we use macros to determine how C routines should be named so that they are callable by Fortran. -DAdd\_: Fortran expects a C routine to have an underscore postfixed to the name; -DNoChange: Fortran expects a C routine name to be identical to that compiled by C; -DUpCase: Fortran expects a C routine name to be all uppercase.  
The intel openapi use uppercase symbol for linking, the gcc use add underscore \_ for linkng.

slu\_cnames.h contain…

```auto
#ifndef __SUPERLU_CNAMES /* allow multiple inclusions */
#define __SUPERLU_CNAMES

#define ADD_ 0
#define ADD__ 1
#define NOCHANGE 2
#define UPCASE 3
#define OLD_CRAY 4
#define C_CALL 5

#ifdef UpCase
#define F77_CALL_C UPCASE
#endif

#ifdef NoChange
#define F77_CALL_C NOCHANGE
#endif

#ifdef Add_
#define F77_CALL_C ADD_
#endif

#ifdef Add__
#define F77_CALL_C ADD__
#endif

#ifdef _CRAY
#define F77_CALL_C OLD_CRAY
#endif

/* Default */
#ifndef F77_CALL_C
#define F77_CALL_C ADD_
#endif

#if (F77_CALL_C == ADD_)
/*
#endif

#if (F77_CALL_C == UPCASE)
/* BLAS */
#define sswap_ SSWAP
#define saxpy_ SAXPY
#define sasum_ SASUM
#endif

...

```

for example in gcc i will had no problem  
for intel that use intel fortran and intel c i had to removed all ifdef except the UPPERCASE in Slu\_cnames.h

Is there any clue to CMAKE to tell intel compiler o use macro UPCASE in header file?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 30, 2022, 7:35pm UTC](https://discourse.cmake.org/t/ifdef-c-header-file-for-multimachine/6946/2 "2022-11-30T19:35:16Z")

</div>

It’s not clear to me what error you got:

- that caused you to remove everything except `UPPERCASE`; or
- what error you have now.

Could you provide more details?
