diff --git a/ltfat_C_kernel/CMakeLists.txt b/ltfat_C_kernel/CMakeLists.txt
index 5328cbde7fe1910cd06e57b0e2ee8c12bb1cc2cd..218fb2da3c0e419efe24d517612a8d40ea4b3f1b 100644
--- a/ltfat_C_kernel/CMakeLists.txt
+++ b/ltfat_C_kernel/CMakeLists.txt
@@ -2,8 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
-#SET(CMAKE_C_FLAGS "-O3 -fPIC -std=c99 -shared")
-SET(CMAKE_C_FLAGS "-O0 -g -fPIC -std=c99")
+SET(CMAKE_C_FLAGS "-O3 -fPIC")
 SET(CMAKE_EXE_LINKER_FLAGS "-lc -lm")
 
 set(SRC dgt.c dgt_fac.c dgt_fb.c dgt_multi.c dgt_ola.c dgt_shear.c dgt_walnut.c
diff --git a/setup.py b/setup.py
index 133f2a26fa3025d00523ea8c6959739ebd7eff29..86138bee5a84a0a42212709e33a1c4815feb05e5 100755
--- a/setup.py
+++ b/setup.py
@@ -234,9 +234,8 @@ def makeExtension(extName, fileExt, lib_dir):
     return Extension(
         extName,
         [extPath],
-        # include_dirs=[numpy.get_include()],
         language="c",
-        # library_dirs=[],
+        extra_compile_args=['-O3'],
         libraries=["fftw3", "m", "blas", "lapack"],
         extra_objects=[os.path.join(lib_dir, "libltfat.a"),
                        os.path.join(lib_dir, "libltfatf.a")],