Skip to content

Commit

Permalink
Switch PThread check and use logic. (#11471) (#11761)
Browse files Browse the repository at this point in the history
* Switch PThread check and use logic.

  - Having PThreads support is now indicated by the compilation commandline
    define `OM_HAVE_PTHREADS`.

    This reverse the logic where we were required to define OMC_NO_THREADS
    when we DID NOT have PThreads.

  - This allows our source code to be compiled (e.g. as part of a source
    code FMU package) without requiring extra defines. If one wants to enable
    PThreads, then one has to define `OM_HAVE_PTHREADS` when compiling the
    sources.

  - OpenModelica's own build define this always, i.e., you are still required
    to have PThreads available to compile OpenModelica itself.
    This can be made optional later if needed.

* Add OM_HAVE_PTHREADS in more palces for the Makefiles.

* Add -DOM_HAVE_PTHREADS to generated code compilation.

* Removed wrong and uncessary declaration of `mmc_stack_overflow_jumper`

  - This looks unused to me.

  - It is also not guarded by anything so if
    someone had defined `OMC_NO_THREADS` in the past (or has not defined
    `OM_HAVE_PTHREADS` now) this will still try to declare a pthread_key_t
    variable erroneously.

    I am not 100% sure why the MSVC build of the SimulationRuntime libraries
    was probably not complaining on this. Feels like there is an unguarded
    `#include <pthreads.h>` somewhere and it ends up using the pthreads
    packed with OMEDev (We have a separate pthreads in OMDev. Not the MinGW
    one.)

* Specify missing return type for function.

* Add the pthreads define for OMEdit Testsuite.

* Adding pthreads to LIBS and gen test in sub directory

* Adding --no-undefined, fixing LIBS for Mac config

* Undo changes to FmuExportCrossCompile

  - Don't change directory for now

---------

Co-authored-by: Mahder Gebremedhin <mahge@users.noreply.github.com>
Co-authored-by: AnHeuermann <38031952+AnHeuermann@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 21, 2023
1 parent c949af0 commit d84fe4a
Show file tree
Hide file tree
Showing 30 changed files with 91 additions and 59 deletions.
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/boot/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LDFLAGS_SHARED_MAIN=-L"$(OMHOME)/$(LIB_OMC)" @RT_LDFLAGS_SHARED@
ifeq (@WITH_FMIL@,yes)
FMILIB = $(TOP_DIR)/3rdParty/FMIL/install/"$(LIB_OMC)"/libfmilib.a
endif
CPPFLAGS=-I"$(OMHOME)/include/omc/c" -I../Util/ @CPPFLAGS@ -DADD_METARECORD_DEFINITIONS=
CPPFLAGS=-DOM_HAVE_PTHREADS -I"$(OMHOME)/include/omc/c" -I../Util/ @CPPFLAGS@ -DADD_METARECORD_DEFINITIONS=
CORBALIBS=@CORBALIBS@
ULIMIT_CMD=true
SHREXT=@DLLEXT@
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/boot/Makefile.omdev.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $(LDFLAGS_CURL) \
$(EXTRA_LD_FLAGS) -Wl,--export-all-symbols

FMILIB = -L$(TOP_DIR)/3rdParty/FMIL/install/lib -lfmilib
CPPFLAGS=-I"$(OMHOME)/include/omc/c" -I../Util/ -DADD_METARECORD_DEFINITIONS=
CPPFLAGS= -DOM_HAVE_PTHREADS -I"$(OMHOME)/include/omc/c" -I../Util/ -DADD_METARECORD_DEFINITIONS=
CORBALIBS=
ULIMIT_CMD=true
SHREXT=.dll
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ set(WITH_UUID "#define WITH_LIBUUID 1")

set(USE_GRAPH 0)

set(RUNTIMECFLAGS "-fPIC")
set(RUNTIMECFLAGS "-fPIC -DOM_HAVE_PTHREADS")

configure_file(${OMCompiler_SOURCE_DIR}/revision.h.in ${OMCompiler_SOURCE_DIR}/revision.h)
configure_file(${OMCompiler_SOURCE_DIR}/omc_config.unix.h.in ${OMCompiler_SOURCE_DIR}/omc_config.unix.h)
Expand Down
4 changes: 4 additions & 0 deletions OMCompiler/Compiler/runtime/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ all: install
install: libomcruntime$(SHREXT) libomcbackendruntime.a
cp libomcruntime$(SHREXT) $(builddir_lib)/$(TRIPLE)/omc/


# If we are using the Makefiles then assume we have PThreads available.
CPPFLAGS += -DOM_HAVE_PTHREADS

OBJEXT=.o
BOOTH=../OpenModelicaBootstrappingHeader.h
ifeq ($(BOOTSTRAPPING),1)
Expand Down
6 changes: 3 additions & 3 deletions OMCompiler/Compiler/runtime/printimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static void free_printimpl(void *data)
free(members);
}

#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
#include <pthread.h>

pthread_once_t printimpl_once_create_key = PTHREAD_ONCE_INIT;
Expand All @@ -94,14 +94,14 @@ static void make_key()

static print_members* getMembers(threadData_t *threadData)
{
#if defined(OMC_NO_THREADS)
#if !defined(OM_HAVE_PTHREADS)
static
#endif
print_members *res = NULL;
if (threadData && threadData->localRoots[LOCAL_ROOT_PRINT_MO]) {
return threadData->localRoots[LOCAL_ROOT_PRINT_MO];
}
#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
pthread_once(&printimpl_once_create_key,make_key);
res = (print_members*) pthread_getspecific(printimplKey);
#endif
Expand Down
2 changes: 2 additions & 0 deletions OMCompiler/Parser/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ANTLRJAR = $(ANTLR)/../tool/antlr-3.2.jar
ANTLRCMD=java -cp $(ANTLRJAR) org.antlr.Tool -Xconversiontimeout 10000 -report
OMC_CONFIG_INC = ../

CPPFLAGS += -DOM_HAVE_PTHREADS

BUILDINC = -I$(OMC_CONFIG_INC) -I../Compiler/runtime -I../SimulationRuntime/c/meta -I../SimulationRuntime/c/ -I../SimulationRuntime/c/meta/gc -I../SimulationRuntime/c/util

.PHONY: all
Expand Down
12 changes: 4 additions & 8 deletions OMCompiler/SimulationRuntime/OMSICpp/omcWrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ SET(OMCCAPI_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/omcCAPI/include")

INCLUDE(../CMake/CheckCXX11.cmake)


if(NOT MSVC)
add_definitions(-DOM_HAVE_PTHREADS)
endif()

#set OpenModelica include directories
INCLUDE_DIRECTORIES(${OMC_PATH}/include/omc/c)
Expand Down Expand Up @@ -69,7 +71,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
ENDIF(NOT WIN32)

#omc c-api library build is only supported for mingw on Windows.
#compatible importlibrary library of the mingw dll can build
#compatible importlibrary library of the mingw dll can build
#in Visual Studio command prompt:
#dumpbin /exports libOMCDLL.dll > libOMCDLL.def
#remove all symbols except the function names
Expand All @@ -91,9 +93,3 @@ if(USE_ZEROMQ AND COMPILER_SUPPORTS_CXX11 AND (NOT ((${CMAKE_SYSTEM_NAME} MATCHE
message (STATUS "build omc zeromq application" )
add_subdirectory(omcZeroMQ)
endif(USE_ZEROMQ AND COMPILER_SUPPORTS_CXX11 AND (NOT ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") )))






2 changes: 1 addition & 1 deletion OMCompiler/SimulationRuntime/ParModelica/auto/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INCDIRS = -I"../../c" -I$(BOOST_HOME) -I$(OMCOMPILER_ROOT)/3rdParty/tbb/include
CC=@CC@
CXX=@CXX@
CFLAGS=@CFLAGS@
CPPFLAGS= -O3 -Wall -DGC_THREADS
CPPFLAGS= -O3 -Wall -DGC_THREADS -DOM_HAVE_PTHREADS

OS_SRCS = pm_posix_timer.cpp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INCDIRS = -I"../../c" -I$(BOOST_HOME) -I$(OMCOMPILER_ROOT)/3rdParty/tbb/include
CC=gcc
CXX=g++
CFLAGS= -O0 -g -Wall
CPPFLAGS= $(CFLAGS) -std=c++11 -DGC_THREADS
CPPFLAGS= $(CFLAGS) -std=c++11 -DGC_THREADS -DOM_HAVE_PTHREADS

OS_SRCS = pm_win_timer.cpp

Expand Down
3 changes: 3 additions & 0 deletions OMCompiler/SimulationRuntime/c/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ INCLUDE_NONFMI=-I. -I$(builddir_inc)/c

CPPFLAGS = -I$(OMC_CONFIG_INC) -I$(top_builddir)/Compiler/runtime -I$(top_builddir)/3rdParty/gc/include -I$(top_builddir)/3rdParty/FMIL/install/include/ -I$(top_builddir)/3rdParty/lis-1.4.12/include/ -I$(builddir_inc)/sundials/ -I$(builddir_inc)/c/suitesparse/ $(CONFIG_CPPFLAGS) -DGC_REDIRECT_TO_LOCAL -DLINK_SUNDIALS_STATIC -DWIN32_LEAN_AND_MEAN

# If we are using the Makefiles then assume we have PThreads available.
CPPFLAGS += -DOM_HAVE_PTHREADS

# On MinGW assume that we have ipopt. For linux this is actually checked and
# configured by autoconf.
ifeq (MINGW,$(findstring MINGW,$(shell uname)))
Expand Down
8 changes: 4 additions & 4 deletions OMCompiler/SimulationRuntime/c/gc/memory_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#endif
#include "omc_gc.h"
#include <string.h>
#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
#include <pthread.h>
#endif
#include "../util/omc_error.h"
Expand All @@ -59,7 +59,7 @@ extern "C" {
/// will also update this.
OMCMemPoolBlock *memory_pools = NULL;

#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
static pthread_mutex_t memory_pool_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif

Expand Down Expand Up @@ -110,7 +110,7 @@ static void* pool_malloc(size_t requested_size)
void *res;
requested_size = round_up(requested_size, 8);

#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
pthread_mutex_lock(&memory_pool_mutex);
#endif

Expand All @@ -129,7 +129,7 @@ static void* pool_malloc(size_t requested_size)
res = (void*)((char*)memory_pools->memory + memory_pools->used);
memory_pools->used += requested_size;

#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
pthread_mutex_unlock(&memory_pool_mutex);
#endif

Expand Down
6 changes: 3 additions & 3 deletions OMCompiler/SimulationRuntime/c/gc/omc_gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" {
#endif

#include <stdlib.h>
#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
#include <pthread.h>
#endif
#include <setjmp.h>
Expand Down Expand Up @@ -135,7 +135,7 @@ typedef struct threadData_s {
jmp_buf *simulationJumpBuffer;
errorStage currentErrorStage;
struct threadData_s *parent;
#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
pthread_mutex_t parentMutex; /* Prevent children from all manipulating the parent at the same time */
#endif
void *plotClassPointer;
Expand Down Expand Up @@ -190,7 +190,7 @@ static inline void* mmc_check_out_of_memory(void *ptr)
// compiler command line so that everything is picked up consistently by all headers.

/* gc.h doesn't include this by default; and the actual header redirects dlopen, which does not have an implementation */
// #if !defined(OMC_NO_THREADS)
// #if defined(OM_HAVE_PTHREADS)
// int GC_pthread_create(pthread_t *,const pthread_attr_t *,void *(*)(void *), void *);
// int GC_pthread_join(pthread_t, void **);
// #endif
Expand Down
2 changes: 0 additions & 2 deletions OMCompiler/SimulationRuntime/c/meta/meta_modelica_segv.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ int mmc_hasStacktraceMessages(threadData_t *threadData)
return threadData->localRoots[LOCAL_ROOT_STACK_OVERFLOW] != 0;
}

pthread_key_t mmc_stack_overflow_jumper;

#if defined(__linux__) || defined(__APPLE_CC__) || defined(__FreeBSD__)
#include <stdlib.h>
#include <stdio.h>
Expand Down
4 changes: 2 additions & 2 deletions OMCompiler/SimulationRuntime/c/util/omc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "omc_init.h"
#include "../meta/meta_modelica_segv.h"

#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
pthread_key_t mmc_thread_data_key = 0;
pthread_once_t mmc_init_once = PTHREAD_ONCE_INIT;
#else
Expand All @@ -41,7 +41,7 @@ threadData_t *OMC_MAIN_THREADDATA_NAME = 0;

void mmc_init_nogc()
{
#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
pthread_key_create(&mmc_thread_data_key,NULL);
#endif
#if !defined(OMC_MINIMAL_RUNTIME)
Expand Down
5 changes: 3 additions & 2 deletions OMCompiler/SimulationRuntime/c/util/omc_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "../openmodelica.h"

#if !defined(OMC_NO_THREADS)
#if defined(OM_HAVE_PTHREADS)
#include <pthread.h>
DLLDirection extern pthread_key_t mmc_thread_data_key;
DLLDirection extern pthread_once_t mmc_init_once;
Expand All @@ -45,9 +45,10 @@ static const int mmc_thread_data_key = 1;
#define OMC_MAIN_THREADDATA_NAME globalThreadData_UnknownModel
#endif
DLLDirection extern threadData_t *OMC_MAIN_THREADDATA_NAME;
static inline pthread_getspecific(int key)
static inline void* pthread_getspecific(int key)
{
assert(key==mmc_thread_data_key);
return NULL;
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ if(NOT FMI2_FUNCTIONS_H)
endif()
message(STATUS "FMI2 include directory: ${FMI_INTERFACE_HEADER_FILES_DIRECTORY}")

# POSIX Threads
if(NOT MSVC)
set(THREADS_PTHREAD_ARG "2" CACHE STRING "Forcibly set by CMakeLists.txt." FORCE)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# Look for a threading library and see if it is PThreads.
find_package(Threads)
# If we find a threading library and it is PThreads then we enable its usage.
if(Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
set(OM_HAVE_PTHREADS ON)
# Otherwise threading will be disabled.
else()
set(OM_HAVE_PTHREADS OFF)
endif()

# Source files
Expand Down Expand Up @@ -127,11 +131,19 @@ if(NOT ${CMAKE_VERSION} VERSION_LESS "3.13")
endif()
endif()

# Link additional libraries
# If we have PThreads support, define OM_HAVE_PTHREADS and link to the imported threading library.
if(OM_HAVE_PTHREADS)
target_compile_definitions(${FMU_NAME} PRIVATE OM_HAVE_PTHREADS)
target_link_libraries(${FMU_NAME} PRIVATE Threads::Threads)
endif()

# If not using MSVC, link to the math library libm.
if(NOT MSVC)
target_link_libraries(${FMU_NAME} PRIVATE m Threads::Threads)
target_link_libraries(${FMU_NAME} PRIVATE m)
endif()

@FMU_ADDITIONAL_LIBS@

if(${NEED_CVODE})
message(STATUS "CVODE_DIRECTORY: ${CVODE_DIRECTORY}")
find_library(SUNDIALS_CVODE_LIBRARY sundials_cvode
Expand All @@ -155,9 +167,7 @@ target_include_directories(${FMU_NAME} PRIVATE ${FMI_INTERFACE_HEADER_FILES_DIRE

# Set compiler definitions
target_compile_definitions(${FMU_NAME} PRIVATE OMC_MINIMAL_RUNTIME=1;OMC_FMI_RUNTIME=1;CMINPACK_NO_DLL${WITH_SUNDIALS})
if(MSVC)
target_compile_definitions(${FMU_NAME} PRIVATE OMC_NO_THREADS)
endif()

if(BUILD_SHARED_LIBS)
# Override FMI2_FUNCTION_PREFIX if FMU compiled dynamically
target_compile_definitions(${FMU_NAME} PRIVATE FMI2_OVERRIDE_FUNCTION_PREFIX)
Expand Down
27 changes: 17 additions & 10 deletions OMCompiler/SimulationRuntime/fmi/export/buildproject/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ AC_MSG_CHECKING([if -Werror works])
AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([ok])], [AC_MSG_ERROR([failed (check your CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS CPPFLAGS=$CPPFLAGS)])])
CFLAGS="$CFLAGS_BEFORE"

# Test for --no-undefine and add it to LDFLAGS if available
LDFLAGS_BEFORE="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--no-undefined -Werror"
AC_MSG_CHECKING([looking for --no-undefined])
AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([yes]);LD_NOUNDEFINED=" -Wl,--no-undefined"], [AC_MSG_RESULT([no])])
LDFLAGS="$LDFLAGS_BEFORE"
LDFLAGS="$LDFLAGS_BEFORE $LD_NOUNDEFINED"

dnl Enable to handle AVR pre-processor not handling $ as symbol names; but fails on assembler anyway

Expand Down Expand Up @@ -215,16 +216,22 @@ else
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_mutex_lock])],[LIBS="$NEWLIBS";PTHREAD_STATIC=1;AC_MSG_RESULT([OK (static)])],[AC_MSG_RESULT([no])])
fi

if ! test "$PTHREAD_STATIC" = 1; then
if test "$PTHREAD_STATIC" = 1; then
CPPFLAGS="$CPPFLAGS -DOM_HAVE_PTHREADS"
else
LIBS="$OLDLIBS -shared"
AC_CHECK_LIB(pthread,[pthread_mutex_lock],[],[
if test "$LIBTYPE_DYNAMIC" = 1; then
AC_MSG_ERROR([pthreads not found and requested dynamic linking])
else
AC_MSG_RESULT([pthreads disabled])
CPPFLAGS="$CPPFLAGS -DOMC_NO_THREADS"
fi
])
AC_CHECK_LIB(pthread,[pthread_mutex_lock],
[
CPPFLAGS="$CPPFLAGS -DOM_HAVE_PTHREADS"
LIBS="$OLDLIBS -lpthread"
],
[
if test "$LIBTYPE_DYNAMIC" = 1; then
AC_MSG_ERROR([pthreads not found and requested dynamic linking])
else
AC_MSG_RESULT([pthreads disabled])
fi
])
fi

AC_CHECK_LIB([m],[cos],[],[AC_MSG_ERROR([math library not found])])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static void omc_assert_fmi_warning(FILE_INFO info, const char *msg, ...)
// ---------------------------------------------------------------------------
static inline void resetThreadData(ModelInstance* comp)
{
#if !OMC_NO_THREADS
#if defined(OM_HAVE_PTHREADS)
if (comp->threadDataParent) {
pthread_setspecific(mmc_thread_data_key, comp->threadDataParent);
}
Expand All @@ -250,7 +250,7 @@ static inline void resetThreadData(ModelInstance* comp)

static inline void setThreadData(ModelInstance* comp)
{
#if !OMC_NO_THREADS
#if defined(OM_HAVE_PTHREADS)
if (comp->threadDataParent) {
pthread_setspecific(mmc_thread_data_key, comp->threadData);
}
Expand Down Expand Up @@ -598,7 +598,7 @@ fmi2Component fmi2Instantiate(fmi2String instanceName, fmi2Type fmuType, fmi2Str
functions->logger(functions->componentEnvironment, instanceName, fmi2Error, "error", "fmi2Instantiate: Out of memory.");
return NULL;
}
#if !OMC_NO_THREADS
#if defined(OM_HAVE_PTHREADS)
pthread_setspecific(mmc_thread_data_key, comp->threadData);
#endif
omc_assert = omc_assert_fmi;
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/SimulationRuntime/opc/ua/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC=@CC@
CFLAGS=-O0 -g -fPIC -fvisibility=hidden -std=c99
CPPFLAGS=-I../../c -I$(OMBUILDDIR)/include/omc/c
CPPFLAGS=-DOM_HAVE_PTHREADS -I../../c -I$(OMBUILDDIR)/include/omc/c
DLLEXT=@DLLEXT@
LDFLAGS=-lpthread
OMBUILDDIR=@OMBUILDDIR@
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/SimulationRuntime/opc/ua/Makefile.omdev.mingw
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC=gcc
override CFLAGS +=-O0 -g -std=c99 -DUA_DYNAMIC_LINKING -DUA_DYNAMIC_LINKING_EXPORT
CPPFLAGS=-I../../c -I$(OMBUILDDIR)/include/omc/c
CPPFLAGS=-DOM_HAVE_PTHREADS -I../../c -I$(OMBUILDDIR)/include/omc/c
LDFLAGS=-lpthread -lwsock32 -lws2_32
DLLEXT=.dll
builddir_lib=$(OMBUILDDIR)/lib/omc
Expand Down
4 changes: 2 additions & 2 deletions OMCompiler/omc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
* Visual Studio then use the SSE instructions,
* not the normal i387 FPU
*/
#define DEFAULT_CFLAGS "-Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse ${MODELICAUSERCFLAGS}"
#define DEFAULT_CFLAGS "-DOM_HAVE_PTHREADS -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse ${MODELICAUSERCFLAGS}"
#else
#define DEFAULT_CFLAGS "-Wno-parentheses-equality -falign-functions ${MODELICAUSERCFLAGS}"
#define DEFAULT_CFLAGS "-DOM_HAVE_PTHREADS -Wno-parentheses-equality -falign-functions ${MODELICAUSERCFLAGS}"
#endif

/* for windows/mingw we don't need -fPIC for x86_64 target, also clang doesn't support it, gcc ignores it */
Expand Down

0 comments on commit d84fe4a

Please sign in to comment.