Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To support ubuntu24, clang 18+, and gcc13. #1804

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,23 @@ AC_PATH_PROG(CLANG, clang, noclang, "$LLVM_BIN_DIR:/bin:/usr/bin:/usr/local/bin:
AS_IF([test "$ac_cv_path_CLANG" = "noclang"],AC_MSG_ERROR([could not find clang]),[])
AC_SUBST([LLVM_HOME])

OLD_CLANG_LIBS="-lclangFrontend -lclangDriver -lclangSerialization -lclangParse -lclangSema -lclangAnalysis -lclangEdit -lclangAST -lclangLex -lclangBasic"
TR_CLANG_VERSION
dnl if llvm/clang, test for version >= 3.4.2
AS_IF([test "x$CLANG_VERSION" = "x"],[],
[AC_MSG_CHECKING([clang version >= 3.4.2])
AX_COMPARE_VERSION([$CLANG_VERSION],[ge],[3.4.2], [AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Trick requires llvm/clang version >= 3.4.2])
])
])

AS_IF([test "x$CLANG_VERSION" = "x"],[],
[AX_COMPARE_VERSION([$CLANG_VERSION],[ge],[18.0.0],
[OLD_CLANG_LIBS="-lclangFrontend -lclangDriver -lclangSerialization -lclangParse -lclangSema -lclangAnalysis -lclangEdit -lclangAST -lclangASTMatchers -lclangAPINotes -lclangLex -lclangBasic"],
[OLD_CLANG_LIBS="-lclangFrontend -lclangDriver -lclangSerialization -lclangParse -lclangSema -lclangAnalysis -lclangEdit -lclangAST -lclangLex -lclangBasic"]
)]
)

NEW_CLANG_LIBS="-lclang-cpp"
AC_CHECK_FILE([$LLVM_LIB_DIR/libclangFrontend.a],
[
Expand Down Expand Up @@ -237,16 +253,6 @@ AC_CHECK_FILE([$LLVM_LIB_DIR/libclangSupport.a],[ICG_CLANGLIBS="$ICG_CLANGLIBS -

AC_SUBST([ICG_CLANGLIBS])

TR_CLANG_VERSION
dnl if llvm/clang, test for version >= 3.4.2
AS_IF([test "x$CLANG_VERSION" = "x"],[],
[AC_MSG_CHECKING([clang version >= 3.4.2])
AX_COMPARE_VERSION([$CLANG_VERSION],[ge],[3.4.2], [AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Trick requires llvm/clang version >= 3.4.2])
])
])

AX_CHECK_ZLIB([],AC_MSG_ERROR([could not find zlib]))

dnl look for udunits in /usr/include and /usr/include/udunits2
Expand Down
178 changes: 116 additions & 62 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions libexec/trick/pm/parse_s_define.pm
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,8 @@ sub handle_sim_class_job($$$) {
$ov_class , $ov_class_self , $sup_class_data, $tag, $job_call, $job_ret, $job_name, $args) = $in_job =~ /
(?:
\s*(?:
([Cc][\w\.\-\>]+) | # child spec
([Pp][\w\.\-\>]+) | # phase spec
([Cc][\w\.\-\>]+)?\s* # child spec
([Pp][\w\.\-\>]+)?\s* # phase spec
(?:
\(
(?:
Expand Down
6 changes: 5 additions & 1 deletion share/trick/makefiles/config_Linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,9 @@ ifeq "" "c++11"
TRICK_ADDITIONAL_CXXFLAGS += -std=c++11 -D_HAVE_STL_RANDOM
endif

TRICK_ADDITIONAL_TEST_FLAGS += -std=c++11
ifeq "" "c++14"
TRICK_ADDITIONAL_CXXFLAGS += -std=c++14 -D_HAVE_STL_RANDOM
endif

TRICK_ADDITIONAL_TEST_FLAGS += -std=c++14

3 changes: 2 additions & 1 deletion test/SIM_mc_generation/S_overrides.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
TRICK_CFLAGS += -g -Wall -Wextra
TRICK_CXXFLAGS += -g -std=c++11 -Wall -Wextra
TRICK_CXXFLAGS += -g -std=c++11 -Wall -Wextra -Wno-error=unused-parameter
# We can't yet make warnings to be errors on MacOS, because
# MACOS deprecates and warns about sprintf. But SWIG
# still generates code containing sprintf..
ifneq ($(TRICK_HOST_TYPE), Darwin)
TRICK_CXXFLAGS += -Werror -Wno-stringop-truncation
endif

4 changes: 2 additions & 2 deletions test/SIM_stls/S_overrides.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

TRICK_CFLAGS += -I./models
TRICK_CFLAGS += -I./models -DTRICK_UNIT_TEST
TRICK_CXXFLAGS += -I./models

TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS += -std=c++11 -DTRICK_UNIT_TEST

clean: checkpoint_clean

Expand Down
1 change: 1 addition & 0 deletions test/SIM_stls/models/STLCheckpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,5 +759,6 @@ int STLCheckpoint::test() {
TRICK_EXPECT_EQ(vec_user_simple[i].d->c, "Here is a test string", test_suite, "vec_user_simple");
}

return 0;

}
2 changes: 1 addition & 1 deletion test/SIM_test_sched/S_overrides.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

TRICK_CFLAGS += -I./models
TRICK_CXXFLAGS += -I./models
TRICK_CXXFLAGS += -std=c++11 -I./models

Loading