-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #666 from mmuetzel/ci
Add build files using autotools to Example package
- Loading branch information
Showing
13 changed files
with
283 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//------------------------------------------------------------------------------ | ||
// SuiteSparse/Example/Demo/my_demo.c | ||
//------------------------------------------------------------------------------ | ||
|
||
// Copyright (c) 2022-2023, Timothy A. Davis, All Rights Reserved. | ||
// SPDX-License-Identifier: BSD-3-clause | ||
|
||
//------------------------------------------------------------------------------ | ||
|
||
// Example user program | ||
|
||
#include <iostream> | ||
|
||
#include "my.h" | ||
|
||
int main (void) | ||
{ | ||
std::cout << "My demo" << std::endl ; | ||
int version [3] ; | ||
char date [128] ; | ||
my_version (version, date) ; | ||
std::cout << "Date from #include 'my.h': " << MY_DATE << std::endl ; | ||
std::cout << "Date from compiled library: " << date << std::endl ; | ||
std::cout << "version from #include 'my.h.': " << | ||
MY_MAJOR_VERSION << '.' << MY_MINOR_VERSION << '.' << MY_PATCH_VERSION << std::endl ; | ||
std::cout << "version from compiled library: " << | ||
version [0] << '.' << version [1] << '.' << version [2] << std::endl ; | ||
|
||
int result = my_function ( ) ; | ||
return (result) ; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#------------------------------------------------------------------------------- | ||
# SuiteSparse/Example/Makefile | ||
#------------------------------------------------------------------------------- | ||
|
||
# Example: Copyright (c) 2023, Timothy A. Davis, All Rights Reserved. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#------------------------------------------------------------------------------- | ||
|
||
# A simple Makefile for the MY library in SuiteSparse/Example, which relies on | ||
# libtool. | ||
|
||
# To compile with an alternate compiler: | ||
# | ||
# make CC=gcc CXX=g++ | ||
# | ||
# To clean up the files: | ||
# | ||
# make clean | ||
|
||
noinst_LTLIBRARIES = \ | ||
%reldir%/libmy.la \ | ||
%reldir%/libmy_cxx.la | ||
|
||
%canon_reldir%_libmy_la_SOURCES = %reldir%/Source/my.c | ||
%canon_reldir%_libmy_la_CPPFLAGS = -I../Include @SUITESPARSE_CFLAGS@ | ||
%canon_reldir%_libmy_la_LIBADD = @SUITESPARSE_LIBS@ | ||
|
||
%canon_reldir%_libmy_cxx_la_SOURCES = %reldir%/Source/my_cxx.cc | ||
%canon_reldir%_libmy_cxx_la_CPPFLAGS = -I../Include @SUITESPARSE_CFLAGS@ | ||
%canon_reldir%_libmy_cxx_la_LIBADD = @SUITESPARSE_LIBS@ | ||
|
||
if AMCOND_HAVE_GRAPHBLAS | ||
%canon_reldir%_libmy_la_CPPFLAGS += @GRAPHBLAS_CFLAGS@ | ||
%canon_reldir%_libmy_la_LIBADD += @GRAPHBLAS_LIBS@ | ||
|
||
%canon_reldir%_libmy_cxx_la_CPPFLAGS += @GRAPHBLAS_CFLAGS@ | ||
%canon_reldir%_libmy_cxx_la_LIBADD += @GRAPHBLAS_LIBS@ | ||
else | ||
%canon_reldir%_libmy_la_CPPFLAGS += -DNO_GRAPHBLAS | ||
|
||
%canon_reldir%_libmy_cxx_la_CPPFLAGS += -DNO_GRAPHBLAS | ||
endif | ||
|
||
if AMCOND_HAVE_LAGRAPH | ||
%canon_reldir%_libmy_la_CPPFLAGS += @LAGRAPH_CFLAGS@ | ||
%canon_reldir%_libmy_la_LIBADD += @LAGRAPH_LIBS@ | ||
|
||
%canon_reldir%_libmy_cxx_la_CPPFLAGS += @LAGRAPH_CFLAGS@ | ||
%canon_reldir%_libmy_cxx_la_LIBADD += @LAGRAPH_LIBS@ | ||
else | ||
%canon_reldir%_libmy_la_CPPFLAGS += -DNO_LAGRAPH | ||
|
||
%canon_reldir%_libmy_cxx_la_CPPFLAGS += -DNO_LAGRAPH | ||
endif | ||
|
||
demo_PROGRAMS = \ | ||
%reldir%/my_demo \ | ||
%reldir%/my_cxx_demo | ||
|
||
demodir = %canon_reldir% | ||
|
||
%canon_reldir%_my_demo_SOURCES = %reldir%/Demo/my_demo.c | ||
%canon_reldir%_my_demo_CPPFLAGS = -I../Include | ||
%canon_reldir%_my_demo_LDADD = %reldir%/libmy.la | ||
|
||
%canon_reldir%_my_cxx_demo_SOURCES = %reldir%/Demo/my_demo.cc | ||
%canon_reldir%_my_cxx_demo_CPPFLAGS = -I../Include | ||
%canon_reldir%_my_cxx_demo_LDADD = %reldir%/libmy_cxx.la |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# simple configure file for example project in SuiteSparse | ||
|
||
# initialize | ||
AC_INIT([example], [1.6.0]) | ||
|
||
AM_INIT_AUTOMAKE([foreign subdir-objects]) | ||
|
||
LT_INIT | ||
|
||
# check for working compilers | ||
AC_PROG_CC | ||
AC_PROG_CXX | ||
|
||
# find pkg-config executable | ||
PKG_PROG_PKG_CONFIG() | ||
|
||
if test "$enable_static" = yes; then | ||
PKG_CONFIG="$PKG_CONFIG --static" | ||
fi | ||
|
||
# find installed SuiteSparse libraries | ||
PKG_CHECK_MODULES([SUITESPARSE], [SuiteSparse_config AMD BTF CAMD CCOLAMD CHOLMOD COLAMD CXSparse KLU KLU_CHOLMOD LDL SuiteSparse_Mongoose ParU RBio SPEX SPQR UMFPACK]) | ||
|
||
PKG_CHECK_MODULES([GRAPHBLAS], [GraphBLAS], [use_graphblas=yes], [use_graphblas=no]) | ||
AM_CONDITIONAL([AMCOND_HAVE_GRAPHBLAS], [test $use_graphblas = yes]) | ||
|
||
PKG_CHECK_MODULES([LAGRAPH], [LAGraph], [use_lagraph=yes], [use_lagraph=no]) | ||
AM_CONDITIONAL([AMCOND_HAVE_LAGRAPH], [test $use_lagraph = yes]) | ||
|
||
# Check if linker flags are needed for function fmax. | ||
# Adds -lm to LIBS if needed. | ||
AC_CHECK_FUNC(fmax, [], AC_CHECK_LIB(m, fmax)) | ||
|
||
# Check for C++ STL. | ||
# If found, this will add -lstdc++ to LIBS. | ||
# FIXME: This is a workaround to allow linking CUDA libraries to a C binary. | ||
AC_CHECK_LIB(stdc++, __gxx_personality_v0) | ||
|
||
# create Makefile.in from Makefile.am | ||
AC_CONFIG_FILES([Makefile]) | ||
AC_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.