IF(NOT LAPACK_FOUND)
	# LAPACK is part of NLC, so get path ---------------------------------------
	IF(${LAPACK_FIND_REQUIRED})
		FIND_PACKAGE(BLAS REQUIRED)
	ELSE()
		FIND_PACKAGE(BLAS)
	ENDIF()

	SET(LAPACK_LINKER_FLAGS)
	SET(LAPACK_LIBRARIES)
	SET(LAPACK_FOUND FALSE)

	IF(${BLAS_FOUND})
		SET(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
		SET(LAPACK_LIBRARIES ${BLAS_LIBRARIES})

		# Determine library type -----------------------------------------------
		IF(${BLA_STATIC})
			SET(BLA_LIB "a")
			SET(BLA_LIB_MSG "Static")
		ELSE()
			SET(BLA_LIB "so")
			SET(BLA_LIB_MSG "Shared")
		ENDIF()

		LIST(APPEND LAPACK_LINKER_FLAGS "lapack")
		LIST(APPEND LAPACK_LIBRARIES "${NLC_PATH}/lib/liblapack.${BLA_LIB}")

		SET(LAPACK_FOUND TRUE)
		FOREACH(A ${LAPACK_LIBRARIES})
			IF(NOT EXISTS ${A})
				IF(${LAPACK_FIND_REQUIRED})
					MESSAGE(FATAL_ERROR "Unable to find ${A}")
				ENDIF()
				SET(LAPACK_FOUND FALSE)
			ENDIF()
		ENDFOREACH()

		IF(${LAPACK_FOUND})
			MESSAGE(STATUS "Using NLC ${NLC_VERSION} LAPACK ${BLA_LIB_MSG}")
		ELSE()
			SET(LAPACK_LINKER_FLAGS)
			SET(LAPACK_LIBRARIES)
		ENDIF()
	
		UNSET(BLA_LIB)
		UNSET(BLA_LIB_MSG)
	ENDIF()

	SET(LAPACK_LINKER_FLAGS ${LAPACK_LINKER_FLAGS} CACHE STRING "")
	SET(LAPACK_LIBRARIES ${LAPACK_LIBRARIES} CACHE STRING "")
	SET(LAPACK95_LIBRARIES "" CACHE STRING "")
	SET(LAPACK95_FOUND FALSE CACHE BOOL "")
	SET(LAPACK_FOUND TRUE CACHE BOOL "")

	MARK_AS_ADVANCED(LAPACK_LINKER_FLAGS LAPACK_LIBRARIES LAPACK95_LIBRARIES LAPACK95_FOUND LAPACK_FOUND)
ENDIF()