Index: src/libcfa/Makefile.am
===================================================================
--- src/libcfa/Makefile.am	(revision 0e76cf4f08013d765530952465f1547e8fd011e2)
+++ src/libcfa/Makefile.am	(revision f773f672efa3c0ef188a8f940384c4a4b307026e)
@@ -56,5 +56,5 @@
 CC = ${abs_top_srcdir}/src/driver/cfa
 
-headers = limits stdlib math iostream fstream iterator rational containers/vector concurrency/threads
+headers = limits stdlib math iostream fstream iterator rational assert containers/vector concurrency/threads
 runtimehdrs = concurrency
 libobjs = ${headers:=.o}
Index: src/libcfa/Makefile.in
===================================================================
--- src/libcfa/Makefile.in	(revision 0e76cf4f08013d765530952465f1547e8fd011e2)
+++ src/libcfa/Makefile.in	(revision f773f672efa3c0ef188a8f940384c4a4b307026e)
@@ -92,6 +92,6 @@
 am__objects_1 = limits.$(OBJEXT) stdlib.$(OBJEXT) math.$(OBJEXT) \
 	iostream.$(OBJEXT) fstream.$(OBJEXT) iterator.$(OBJEXT) \
-	rational.$(OBJEXT) containers/vector.$(OBJEXT) \
-	concurrency/threads.$(OBJEXT)
+	rational.$(OBJEXT) assert.$(OBJEXT) \
+	containers/vector.$(OBJEXT) concurrency/threads.$(OBJEXT)
 am_libcfa_a_OBJECTS = libcfa-prelude.$(OBJEXT) $(am__objects_1)
 libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS)
@@ -235,5 +235,5 @@
 cfalib_DATA = builtins.cf extras.cf prelude.cf
 MAINTAINERCLEANFILES = builtins.cf extras.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
-headers = limits stdlib math iostream fstream iterator rational containers/vector concurrency/threads
+headers = limits stdlib math iostream fstream iterator rational assert containers/vector concurrency/threads
 runtimehdrs = concurrency
 libobjs = ${headers:=.o}
@@ -335,4 +335,5 @@
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assert.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstream.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iostream.Po@am__quote@
Index: src/libcfa/assert
===================================================================
--- src/libcfa/assert	(revision f773f672efa3c0ef188a8f940384c4a4b307026e)
+++ src/libcfa/assert	(revision f773f672efa3c0ef188a8f940384c4a4b307026e)
@@ -0,0 +1,34 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// assert --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Nov 28 12:27:26 2016
+// Last Modified By : Thierry Delisle
+// Last Modified On : Mon Nov 28 12:27:26 2016
+// Update Count     : 0
+//
+
+#ifndef __ASSERT_H__
+#define __ASSERT_H__
+
+extern "C" {
+	#include <assert.h>
+
+	#define __STRINGIFY__(str) #str
+	#define __VSTRINGIFY__(str) __STRINGIFY__(str)
+	#define assertf(expr, fmt, ...) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ ))
+
+	void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn));
+}
+
+#endif // __ASSERT_H__
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/libcfa/assert.c
===================================================================
--- src/libcfa/assert.c	(revision f773f672efa3c0ef188a8f940384c4a4b307026e)
+++ src/libcfa/assert.c	(revision f773f672efa3c0ef188a8f940384c4a4b307026e)
@@ -0,0 +1,47 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// assert.c --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Nov 28 12:27:26 2016
+// Last Modified By : Thierry Delisle
+// Last Modified On : Mon Nov 28 12:27:26 2016
+// Update Count     : 0
+//
+
+#include "assert"
+#include "stdlib"										// abort
+
+extern "C" {
+	#include <stdarg.h>								// varargs
+	#include <stdio.h>								// fprintf
+
+	extern const char * __progname;						// global name of running executable (argv[0])
+
+	#define CFA_ASSERT_FMT "*CFA assertion error* from program \"%s\" in \"%s\" at line %d in file \"%s\""
+
+	// called by macro assert in assert.h
+	void __assert_fail( const char *assertion, const char *file, unsigned int line, const char *function ) {
+		fprintf( stderr, CFA_ASSERT_FMT ".\n", __progname, function, line, file );
+		abort();
+	}
+
+	// called by macro assertf
+	void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) {
+		fprintf( stderr, CFA_ASSERT_FMT ": ", __progname, function, line, file );
+		va_list args;
+		va_start( args, fmt );
+		vfprintf( stderr, fmt, args );
+		abort();
+	}
+
+}
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
